Beginner ⏱ 75 min πŸ“‹ 10 Steps

Deploy Endpoint DLP with Defender XDR Integration

Deploy Microsoft Purview Endpoint DLP, configure USB, print, clipboard, and cloud upload monitoring, create DLP policies for sensitive data on devices, and investigate DLP alerts in the unified Defender XDR portal.

πŸ“‹ Overview

About This Lab

Microsoft Purview Data Loss Prevention for Endpoints (Endpoint DLP) extends DLP policies to Windows and macOS devices, monitoring and controlling sensitive data as it is copied, printed, uploaded to cloud services, transferred via Bluetooth, or accessed by unallowed apps. Integrated into the Defender XDR portal, Endpoint DLP provides unified alerts alongside endpoint, email, and identity signals.

🏒 Enterprise Use Case

A consulting firm discovers that employees frequently copy client financial data to USB drives and personal cloud storage. The compliance team mandates per-device DLP enforcement: block USB transfers of files containing financial data, warn on cloud uploads, and audit printing of confidential documents. all without impacting access to approved business applications.

🎯 What You Will Learn

  1. Understand Endpoint DLP architecture and MDE integration
  2. Verify Endpoint DLP prerequisites and device onboarding
  3. Configure Endpoint DLP settings and unallowed apps
  4. Create DLP policies scoped to endpoint activities
  5. Configure activity monitoring: copy to USB, print, upload, clipboard
  6. Set up notification templates for end users
  7. Test endpoint DLP policies with controlled scenarios
  8. Monitor DLP alerts in the Defender XDR portal
  9. Investigate Endpoint DLP incidents
  10. Tune policies and manage exceptions

πŸ”‘ Why This Matters

Cloud DLP protects data at rest and in transit through email and SaaS apps, but sensitive data also moves through endpoints. USB drives, printers, clipboard operations, and local apps. Without Endpoint DLP, these channels remain unmonitored, creating data exfiltration paths that bypass all cloud-based controls.

βš™οΈ Prerequisites

  • Licensing: Microsoft 365 E5, E5 Compliance, or E5 Information Protection & Governance add-on
  • Operating System: Windows 10/11 Enterprise or Education (build 1809+) or macOS 12+ (Monterey)
  • MDE Onboarding: Target devices must be onboarded to Microsoft Defender for Endpoint (MDE sensor active)
  • Portal Access: Compliance Administrator or Global Administrator role in compliance.microsoft.com
  • PowerShell: Security & Compliance PowerShell module (Connect-IPPSSession) for policy automation
  • Network: Outbound HTTPS (443) to Microsoft compliance and MDE service URLs from all endpoints
  • Microsoft Edge: Chromium-based Edge for browser-level DLP enforcement on endpoints
  • Antivirus: Microsoft Defender Antivirus in active mode (required for full Endpoint DLP functionality)
⚠️ Important: Endpoint DLP requires the MDE sensor - it is not a standalone agent. If devices are not onboarded to MDE, endpoint DLP policies will have no effect. Verify onboarding in the Defender portal before proceeding.

Step 1 Β· Verify Endpoint DLP Prerequisites

Before enabling Endpoint DLP, confirm that target devices are properly onboarded to Microsoft Defender for Endpoint (MDE). Endpoint DLP relies on the MDE sensor to monitor file activities on devices - without a healthy MDE onboarding, DLP policies cannot detect or block data exfiltration through USB, print, clipboard, or cloud upload channels.

Verify Device Onboarding Status

  1. Confirm all target devices run Windows 10/11 Enterprise or Education (build 1809+) or macOS 12+ (Monterey)
  2. Verify Microsoft 365 E5, E5 Compliance, or E5 Information Protection & Governance licensing is assigned to users
  3. Navigate to Purview compliance portal > Settings > Device onboarding and verify the device count
  4. Cross-reference with the Defender portal device inventory to confirm sensor health status
# ---------------------------------------------------------
# WHAT: Verify MDE onboarding status and Endpoint DLP readiness
# WHY:  Endpoint DLP requires a healthy MDE sensor on each device.
#       If devices aren't onboarded or the sensor is inactive,
#       DLP policies won't monitor file activities on those endpoints.
# ---------------------------------------------------------

# Check if the MDE service (Sense) is running on the local device
# OUTPUT: Status=Running means the MDE sensor is active
Get-Service -Name "Sense" | Select-Object Name, Status, StartType

# Verify MDE onboarding state via registry
# OUTPUT: OnboardingState=1 means fully onboarded to MDE
$regPath = "HKLM:\SOFTWARE\Microsoft\Windows Advanced Threat Protection\Status"
Get-ItemProperty -Path $regPath -ErrorAction SilentlyContinue |
    Select-Object OnboardingState, OrgId, LastConnected

# Check Endpoint DLP capability via DLP-specific registry key
# OUTPUT: If present, confirms Endpoint DLP feature is enabled
$dlpPath = "HKLM:\SOFTWARE\Microsoft\Windows Advanced Threat Protection\DLP"
if (Test-Path $dlpPath) {
    Get-ItemProperty -Path $dlpPath
    Write-Host "Endpoint DLP is enabled on this device." -ForegroundColor Green
} else {
    Write-Host "Endpoint DLP registry key not found - verify licensing and policy." -ForegroundColor Yellow
}

# Bulk check: query all devices in a target OU for MDE sensor status
# WHY: Before rolling out DLP, confirm fleet-wide MDE onboarding
$computers = Get-ADComputer -Filter * -SearchBase "OU=Workstations,DC=contoso,DC=com"
foreach ($pc in $computers) {
    $status = Invoke-Command -ComputerName $pc.Name -ScriptBlock {
        $svc = Get-Service -Name "Sense" -ErrorAction SilentlyContinue
        [PSCustomObject]@{
            Computer = $env:COMPUTERNAME
            SenseRunning = ($svc.Status -eq 'Running')
            OSVersion = [System.Environment]::OSVersion.Version.ToString()
        }
    } -ErrorAction SilentlyContinue
    $status
} | Format-Table -AutoSize
💡 Pro Tip: Run mdatp health from an elevated command prompt on any device to get a detailed MDE sensor health report including organization ID, real-time protection status, and last cloud connection time.

Step 2 Β· Configure Endpoint DLP Settings

Endpoint DLP settings define the global controls applied to all endpoint DLP policies. These settings include unallowed apps (applications that cannot access protected files), unallowed Bluetooth apps, browser and domain restrictions, and file path exclusions. Configuring these settings correctly before creating policies ensures consistent enforcement across your organization.

Configure Global Endpoint DLP Settings

  1. Navigate to Purview compliance portal > Data loss prevention > Endpoint DLP settings
  2. Under Unallowed apps, add personal cloud storage clients (Dropbox, personal OneDrive, Google Drive)
  3. Under Unallowed Bluetooth apps, restrict sensitive file transfer via Bluetooth
  4. Under Browser and domain restrictions, add domains where clipboard paste of sensitive data should be monitored
  5. Under File path exclusions, exclude system paths and approved automation folders (e.g., backup agents)
# ---------------------------------------------------------
# WHAT: Configure Endpoint DLP global settings via PowerShell
# WHY:  These settings apply to ALL Endpoint DLP policies and define
#       which apps, browsers, and paths are restricted or excluded.
#       Setting these before creating policies avoids conflicts.
# PREREQ: Connect-IPPSSession (Security & Compliance PowerShell)
# ---------------------------------------------------------

# Connect to Security & Compliance PowerShell
Connect-IPPSSession -UserPrincipalName admin@contoso.com

# Add unallowed apps - these apps will be blocked from accessing
# files that match DLP policies on endpoints
# WHY: Personal cloud storage apps are common data exfiltration vectors
Set-PolicyConfig -EndpointDlpGlobalSetting -Setting UnallowedApp `
    -Value @(
        @{Value = "dropbox.exe"; DisplayName = "Dropbox"},
        @{Value = "googledrivesync.exe"; DisplayName = "Google Drive"},
        @{Value = "iclouddrv.exe"; DisplayName = "Apple iCloud Drive"},
        @{Value = "megasync.exe"; DisplayName = "MEGA Sync"}
    )

# Add unallowed Bluetooth apps
# WHY: Bluetooth transfers can bypass network DLP controls entirely
Set-PolicyConfig -EndpointDlpGlobalSetting -Setting UnallowedBluetoothApp `
    -Value @(
        @{Value = "fsquirt.exe"; DisplayName = "Bluetooth File Transfer"}
    )

# Configure browser and domain restrictions
# WHY: Monitor or block paste of sensitive data into unsanctioned web apps
Set-PolicyConfig -EndpointDlpGlobalSetting -Setting UnallowedBrowser `
    -Value @(
        @{Value = "chrome.exe"; DisplayName = "Google Chrome (unmanaged)"}
    )

# Add file path exclusions for legitimate business processes
# WHY: Backup agents and system processes generate false positives
Set-PolicyConfig -EndpointDlpGlobalSetting -Setting FilePathExclusion `
    -Value @(
        "C:\Windows\",
        "C:\Program Files\BackupAgent\",
        "C:\ProgramData\Microsoft\Windows Defender\"
    )
💡 Pro Tip: Use Get-PolicyConfig to review current Endpoint DLP settings before making changes. Always document your baseline configuration so you can roll back if enforcement is too aggressive during initial deployment.

Step 3 Β· Create an Endpoint DLP Policy

With endpoint settings configured, create a DLP policy that specifically targets the Devices location. This policy defines what sensitive information types to detect and which endpoint activities to monitor or block. Scoping the policy to Devices ensures it applies only to on-device activities like USB copies, printing, and cloud uploads - not to Exchange or SharePoint.

Create the Endpoint DLP Policy

  1. Navigate to DLP > Policies > + Create policy
  2. Select template: Financial > U.S. Financial Data (or create custom)
  3. Name: Protect Financial Data on Endpoints
  4. Scope to Devices only (Endpoint DLP location)
  5. Define content conditions: Credit Card Number, U.S. Bank Account Number, ABA Routing Number
  6. Set activities: Copy to USB, Print, Copy to clipboard, Upload to cloud service, Transfer via Bluetooth
  7. Set actions: Block for USB and cloud upload, Audit for print and clipboard
  8. Enable user notifications with override and business justification
# ---------------------------------------------------------
# WHAT: Create an Endpoint DLP policy for financial data protection
# WHY:  Policies define what sensitive data to detect and how endpoint
#       activities are controlled (block, warn, audit). Scoping to
#       "Devices" ensures only on-device actions are monitored.
# PREREQ: Connect-IPPSSession
# ---------------------------------------------------------

# Step 1: Create the DLP compliance policy scoped to Devices
# The -EndpointDlpLocation "All" targets all onboarded endpoints
New-DlpCompliancePolicy -Name "Protect Financial Data on Endpoints" `
    -Comment "Blocks USB and cloud upload of financial data; audits print and clipboard" `
    -EndpointDlpLocation "All" `
    -Mode "Enable"

# Step 2: Create a compliance rule with sensitive information types
# and activity-specific enforcement actions
New-DlpComplianceRule -Name "Block Financial Data Exfiltration" `
    -Policy "Protect Financial Data on Endpoints" `
    -ContentContainsSensitiveInformation @(
        @{Name = "Credit Card Number"; minCount = 1},
        @{Name = "U.S. Bank Account Number"; minCount = 1},
        @{Name = "ABA Routing Number"; minCount = 1}
    ) `
    -EndpointDlpRestrictions @(
        @{Setting = "CopyToRemovableMedia"; Value = "Block"},
        @{Setting = "CloudAppEgress"; Value = "Block"},
        @{Setting = "Print"; Value = "Audit"},
        @{Setting = "CopyToClipboard"; Value = "Audit"},
        @{Setting = "BluetoothTransfer"; Value = "Block"}
    ) `
    -NotifyUser "SiteAdmin" `
    -NotifyUserType "NotifyOnly" `
    -GenerateIncidentReport "SiteAdmin"

# Verify the policy was created successfully
Get-DlpCompliancePolicy -Identity "Protect Financial Data on Endpoints" |
    Format-List Name, Mode, EndpointDlpLocation, IsValid
💡 Pro Tip: Start with -Mode "TestWithNotifications" instead of "Enable" to simulate enforcement without blocking users. This lets you validate detection accuracy and measure false positive rates before enabling real enforcement.

Step 4 Β· Configure Activity-Specific Controls

Different endpoint activities carry different risk levels. USB transfers and cloud uploads are high-risk exfiltration channels that warrant blocking, while printing and clipboard operations may only need monitoring to avoid disrupting daily workflows. Configure granular rules for each activity type, applying appropriate enforcement levels based on data sensitivity.

Define Activity-Specific Enforcement

  1. Copy to USB: Block with no override for Highly Confidential; allow with override and justification for Confidential
  2. Print: Audit and warn - users see a notification but can proceed after acknowledging the policy
  3. Upload to cloud: Block for unallowed apps; allow for sanctioned cloud storage (e.g., corporate OneDrive)
  4. Copy to clipboard: Audit only - monitor without disrupting user workflow
  5. Access by unallowed apps: Block access to sensitive files by apps on the unallowed list
# ---------------------------------------------------------
# WHAT: Create tiered enforcement rules per activity and sensitivity level
# WHY:  A single policy can contain multiple rules, each targeting
#       different sensitivity levels with appropriate enforcement.
#       This allows strict protection for top-secret data and
#       lighter controls for general confidential content.
# ---------------------------------------------------------

# Rule for Highly Confidential data - strictest enforcement
# Block USB, cloud, Bluetooth, and unallowed app access with NO override
New-DlpComplianceRule -Name "Highly Confidential - Block All Exfiltration" `
    -Policy "Protect Financial Data on Endpoints" `
    -ContentContainsSensitiveInformation @(
        @{Name = "Credit Card Number"; minCount = 5},
        @{Name = "U.S. Bank Account Number"; minCount = 3}
    ) `
    -EndpointDlpRestrictions @(
        @{Setting = "CopyToRemovableMedia"; Value = "Block"},
        @{Setting = "CloudAppEgress"; Value = "Block"},
        @{Setting = "Print"; Value = "Warn"},
        @{Setting = "CopyToClipboard"; Value = "Warn"},
        @{Setting = "BluetoothTransfer"; Value = "Block"},
        @{Setting = "UnallowedApp"; Value = "Block"}
    ) `
    -BlockAccess $true `
    -BlockAccessScope "All"

# Rule for Confidential data - allow override with business justification
# WHY: Some workflows legitimately require USB transfer of confidential data
Set-DlpComplianceRule -Identity "Block Financial Data Exfiltration" `
    -EndpointDlpRestrictions @(
        @{Setting = "CopyToRemovableMedia"; Value = "Warn"},
        @{Setting = "CloudAppEgress"; Value = "Block"},
        @{Setting = "Print"; Value = "Audit"},
        @{Setting = "CopyToClipboard"; Value = "Audit"},
        @{Setting = "BluetoothTransfer"; Value = "Warn"}
    ) `
    -NotifyUser "SiteAdmin" `
    -NotifyUserType "NotifyOnly"

# Verify all rules under the policy
Get-DlpComplianceRule -Policy "Protect Financial Data on Endpoints" |
    Format-Table Name, @{N='Priority';E={$_.Priority}}, IsValid -AutoSize
💡 Pro Tip: Create separate rules for different sensitivity tiers within the same policy. Higher-priority rules with stricter enforcement for bulk financial data (5+ matches) will trigger first, while lower-priority rules handle individual matches with lighter controls.

Step 5 Β· Set Up User Notification Templates

User notifications are the frontline of DLP education. When a policy blocks or warns a user, the notification must clearly explain what happened, why the data is protected, and how to request an exception if the action is legitimate. Well-crafted notifications reduce helpdesk tickets and improve user compliance over time.

Design Effective Notifications

  1. Create clear, actionable notification messages for each activity type (USB block, cloud upload block, print warning)
  2. Include the following in every notification:
    • What action was blocked or flagged
    • Why the data is protected (policy name and description)
    • How to request a business justification override
    • A link to your organization’s data handling policy
  3. Configure the Override option with a business justification requirement - this creates an audit trail of approved exceptions
  4. Test notifications from the end-user perspective on a pilot device before rolling out to production
💡 Pro Tip: Avoid generic messages like "This action is blocked." Instead, use specific language such as "This file contains credit card data and cannot be copied to USB storage per the Financial Data Protection Policy. Click Override to provide a business justification." Specificity reduces repeat violations by up to 40%.

Step 6 Β· Test Endpoint DLP Policies

Before rolling out to production, validate that your Endpoint DLP policies correctly detect sensitive data and enforce the expected actions. Testing should cover all protected activities - USB copy, print, cloud upload, and clipboard - using realistic test data on a device within your pilot group.

Generate Test Files and Trigger DLP Detection

  1. Create a test file containing sample credit card numbers on a device in the pilot deployment group
  2. Attempt to copy the file to a USB drive - verify the Block notification appears
  3. Attempt to print the file - verify the Audit/Warn notification appears
  4. Attempt to upload to a personal cloud storage app (e.g., Dropbox) - verify the Block notification
  5. Wait 15–30 minutes, then verify the activity appears in Activity Explorer in the Purview portal
# ---------------------------------------------------------
# WHAT: Create a test file with synthetic sensitive data to trigger DLP
# WHY:  You need realistic test data to validate that endpoint DLP
#       policies detect sensitive content and enforce the correct action.
#       Use well-known test credit card numbers (Luhn-valid but not real).
# IMPORTANT: Only run this on designated test devices in your pilot group.
# ---------------------------------------------------------

# Create a test directory for DLP validation
$testPath = "$env:USERPROFILE\Desktop\DLP-Test"
New-Item -Path $testPath -ItemType Directory -Force | Out-Null

# Generate a test file with synthetic financial data
# WHY: These are Luhn-valid test card numbers that DLP classifiers detect
#      but are not real financial instruments (widely used for testing)
$testContent = @"
=== CONFIDENTIAL FINANCIAL REPORT ===
Date: $(Get-Date -Format 'yyyy-MM-dd')

Customer: Test Account
Credit Card: 4111-1111-1111-1111
Credit Card: 5500-0000-0000-0004
Credit Card: 3400-0000-0000-009
Bank Account: 123456789
ABA Routing: 021000021
SSN: 078-05-1120

Total Balance: 45,230.00
=== END CONFIDENTIAL REPORT ===
"@

$testContent | Out-File -FilePath "$testPath\Financial-Report-Test.txt" -Encoding UTF8
Write-Host "Test file created: $testPath\Financial-Report-Test.txt" -ForegroundColor Cyan

# Manual testing instructions:
Write-Host "`nManual testing checklist:" -ForegroundColor Yellow
Write-Host "1. Insert a USB drive and copy the test file - expect BLOCK" -ForegroundColor White
Write-Host "2. Open the file and press Ctrl+P - expect WARN/AUDIT" -ForegroundColor White
Write-Host "3. Drag the file to a Dropbox/Google Drive folder - expect BLOCK" -ForegroundColor White
Write-Host "4. Copy file contents and paste into a browser - expect AUDIT" -ForegroundColor White
Write-Host "5. Check Activity Explorer in 15-30 minutes for events" -ForegroundColor White
💡 Pro Tip: Use -Mode "TestWithNotifications" on your policy during validation. This shows users the exact notifications they will receive in production but does not actually block any actions - perfect for user acceptance testing before enabling full enforcement.

Step 7 Β· Monitor DLP Alerts in Defender XDR

Endpoint DLP alerts flow into the Defender XDR portal alongside endpoint, identity, and email alerts, providing a unified view of data security events. In Advanced Hunting, the DeviceEvents table captures DLP-related device events, while AlertInfo and AlertEvidence tables contain structured alert data for correlation and investigation.

Review DLP Alerts in Defender XDR

  1. Navigate to Incidents & alerts in the Defender XDR portal
  2. Filter by Service source: Microsoft Data Loss Prevention
  3. Review DLP incidents and their correlated alerts - note how endpoint, email, and identity signals merge
  4. Open Advanced Hunting to query DLP events across your fleet
  5. Use the unified timeline to see DLP violations in the context of other user activities
// ---------------------------------------------------------
// WHAT: Hunt for Endpoint DLP alerts in the Defender XDR portal
// WHY:  The AlertInfo table centralizes all DLP alerts alongside
//       endpoint and identity signals. Cross-referencing with
//       DeviceEvents reveals the full chain of user actions that
//       preceded and followed the DLP violation.
// WHERE: Advanced Hunting in security.microsoft.com
// ---------------------------------------------------------

// Query 1: All DLP alerts from the last 7 days
// Shows alert title, severity, device, and the specific DLP policy triggered
AlertInfo
| where Timestamp > ago(7d)
| where ServiceSource == "Microsoft Data Loss Prevention"
| join kind=inner AlertEvidence on AlertId
| where EntityType == "Machine" or EntityType == "User"
| project Timestamp, AlertId, Title, Severity,
          DeviceName, AccountUpn,
          Category, DetectionSource
| order by Timestamp desc

// Query 2: Endpoint DLP activity events from DeviceEvents
// WHY: DeviceEvents captures the raw endpoint activity (USB copy,
//      print, clipboard, cloud upload) before it becomes an alert
DeviceEvents
| where Timestamp > ago(7d)
| where ActionType startswith "Dlp"
| summarize EventCount = count() by ActionType, DeviceName, bin(Timestamp, 1d)
| order by EventCount desc

// Query 3: Top devices triggering DLP events
// WHY: Identifies devices that may need additional user training
//      or represent genuine data exfiltration attempts
DeviceEvents
| where Timestamp > ago(30d)
| where ActionType startswith "Dlp"
| summarize TotalEvents = count(),
            BlockEvents = countif(ActionType contains "Blocked"),
            AuditEvents = countif(ActionType contains "Audited")
    by DeviceName
| order by TotalEvents desc
| take 20
💡 Pro Tip: Create a custom detection rule from your KQL query to automatically generate alerts when a single device exceeds 10 DLP block events in a 24-hour window. This surfaces potential data exfiltration attempts without manual monitoring.

Step 8 Β· Investigate an Endpoint DLP Incident

When a DLP incident is raised, the investigation should go beyond the single alert. Correlate the DLP violation with the user’s broader activity - logon patterns, other alerts, file access history - to determine whether this is accidental exposure, policy misunderstanding, or intentional data exfiltration.

Investigate with Identity Correlation

  1. Click on a DLP incident to view the full investigation page
  2. Review the Evidence tab: matched sensitive info types, file details, and activity type
  3. Check the User entity: is this a repeat offender or first-time violation?
  4. Review the device timeline: what other activities occurred around the same time?
  5. Use Advanced Hunting KQL to correlate DLP events with identity and device signals
// ---------------------------------------------------------
// WHAT: Investigate a DLP incident with full identity correlation
// WHY:  A single DLP alert may be accidental - but combined with
//       unusual sign-in patterns, risky app usage, or mass file
//       access, it can indicate insider threat or compromised account.
// ---------------------------------------------------------

// Query 1: Full user activity timeline around a DLP incident
// Replace "user@contoso.com" with the actual user from the alert
let targetUser = "user@contoso.com";
let incidentTime = datetime(2026-03-10T14:00:00Z);
// Device activity: file operations, process launches, network connections
DeviceEvents
| where Timestamp between ((incidentTime - 1h) .. (incidentTime + 1h))
| where AccountUpn =~ targetUser
| project Timestamp, ActionType, FileName, FolderPath,
          RemoteUrl, DeviceName
| order by Timestamp asc

// Query 2: Check for repeat DLP violations by the same user
// WHY: Repeat offenders may need targeted training or investigation
AlertInfo
| where Timestamp > ago(90d)
| where ServiceSource == "Microsoft Data Loss Prevention"
| join kind=inner AlertEvidence on AlertId
| where AccountUpn =~ "user@contoso.com"
| summarize IncidentCount = dcount(AlertId),
            DistinctPolicies = make_set(Title),
            FirstSeen = min(Timestamp),
            LastSeen = max(Timestamp)
    by AccountUpn
| extend DaysBetween = datetime_diff('day', LastSeen, FirstSeen)

// Query 3: Correlate DLP events with identity risk signals
// WHY: A DLP violation from a user with a risky sign-in is higher severity
AlertInfo
| where Timestamp > ago(7d)
| where ServiceSource == "Microsoft Data Loss Prevention"
| join kind=inner AlertEvidence on AlertId
| where EntityType == "User"
| join kind=leftouter (
    AADSignInEventsBeta
    | where Timestamp > ago(7d)
    | where RiskLevelDuringSignIn in ("high", "medium")
    | project AccountUpn = UserPrincipalName, RiskLevel = RiskLevelDuringSignIn,
              SignInTime = Timestamp, IPAddress, Country
) on AccountUpn
| where isnotempty(RiskLevel)
| project Timestamp, Title, AccountUpn, RiskLevel, IPAddress, Country
💡 Pro Tip: If a user has both a DLP violation and a risky sign-in within the same timeframe, escalate the incident to your insider risk management team. This correlation pattern often indicates a compromised account being used for data exfiltration.

Step 9 Β· Review Activity Explorer and Reports

Activity Explorer in the Purview portal provides a visual interface for reviewing DLP matches, overrides, and false positive reports. For deeper analysis - trend identification, baseline establishment, and executive reporting - use Advanced Hunting KQL queries to aggregate DLP event data over time and across organizational boundaries.

Analyze DLP Match Trends

  1. Navigate to Purview > Data loss prevention > Activity Explorer
  2. Filter by Location: Endpoint devices
  3. Review activity trends: most common violation types, top users, top file types
  4. Export activity data for compliance reporting
  5. Switch to Advanced Hunting for KQL-based analysis of DLP match trends
// ---------------------------------------------------------
// WHAT: Analyze Endpoint DLP match trends for reporting
// WHY:  Trend analysis reveals whether DLP policies are effective,
//       if specific teams need training, and whether false positive
//       rates are acceptable. This data feeds executive dashboards.
// ---------------------------------------------------------

// Query 1: Daily DLP event trend - block vs audit vs override
// WHY: Shows whether enforcement is increasing or decreasing over time
DeviceEvents
| where Timestamp > ago(30d)
| where ActionType startswith "Dlp"
| extend EventCategory = case(
    ActionType contains "Blocked", "Blocked",
    ActionType contains "Audited", "Audited",
    ActionType contains "Warned", "Warned",
    "Other")
| summarize EventCount = count() by EventCategory, bin(Timestamp, 1d)
| order by Timestamp asc
| render timechart

// Query 2: Top sensitive information types triggering DLP
// WHY: Identifies which data types are most at risk on endpoints
AlertInfo
| where Timestamp > ago(30d)
| where ServiceSource == "Microsoft Data Loss Prevention"
| join kind=inner AlertEvidence on AlertId
| where EntityType == "File"
| extend SensitiveType = tostring(parse_json(AdditionalFields).SensitiveInformationType)
| summarize MatchCount = count() by SensitiveType
| order by MatchCount desc
| take 10

// Query 3: Department-level DLP summary for compliance reporting
// WHY: Compliance teams need per-department breakdowns to demonstrate
//      policy effectiveness and identify training gaps
AlertInfo
| where Timestamp > ago(30d)
| where ServiceSource == "Microsoft Data Loss Prevention"
| join kind=inner AlertEvidence on AlertId
| where EntityType == "User"
| extend Department = tostring(parse_json(AdditionalFields).Department)
| summarize TotalAlerts = count(),
            HighSeverity = countif(Severity == "High"),
            MediumSeverity = countif(Severity == "Medium")
    by Department
| order by TotalAlerts desc
💡 Pro Tip: Schedule a weekly KQL report using Microsoft Sentinel playbooks or Power Automate to automatically email DLP trend summaries to compliance stakeholders. This ensures visibility without manual effort.

Step 10 Β· Tune Policies and Manage Exceptions

After the initial deployment period (typically 2–4 weeks), review false positive data, user feedback, and override reports to refine your DLP policies. Tuning involves adjusting sensitive information type thresholds, adding file path or user group exclusions, and modifying enforcement levels based on real-world operational data.

Tune and Refine DLP Rules

  1. Review false positives from the first 2–4 weeks of operation in Activity Explorer
  2. Add file path exclusions for legitimate business workflows
  3. Adjust sensitive information type thresholds (e.g., require 5+ credit card numbers instead of 1)
  4. Create exception groups for users who legitimately handle sensitive data (e.g., finance team)
  5. Document all exceptions with business justification and expiry dates
# ---------------------------------------------------------
# WHAT: Tune DLP compliance rules to reduce false positives
# WHY:  Initial deployment often catches legitimate workflows.
#       Tuning thresholds and adding exceptions balances security
#       with productivity - reducing user friction improves adoption.
# PREREQ: Connect-IPPSSession
# ---------------------------------------------------------

# Increase the minimum instance count for credit card detection
# WHY: A single credit card number in a file is often a false positive
#      (e.g., test data, personal expense reports). Requiring 5+
#      instances targets bulk financial data movement.
Set-DlpComplianceRule -Identity "Block Financial Data Exfiltration" `
    -ContentContainsSensitiveInformation @(
        @{Name = "Credit Card Number"; minCount = 5; maxCount = -1},
        @{Name = "U.S. Bank Account Number"; minCount = 2; maxCount = -1},
        @{Name = "ABA Routing Number"; minCount = 1; maxCount = -1}
    )

# Add file path exclusions for the finance team's approved workflow
# WHY: The finance team legitimately transfers financial data to
#      an approved encrypted USB drive for quarterly audits
Set-DlpComplianceRule -Identity "Block Financial Data Exfiltration" `
    -ExceptIfContentPropertyContainsWords @("Document.Department:Finance") `
    -ExceptIfFrom "FinanceTeam@contoso.com"

# Change USB enforcement from Block to Warn for Confidential data
# WHY: Blocking all USB transfers caused too many support escalations;
#      Warn with override provides a balance of security and productivity
Set-DlpComplianceRule -Identity "Block Financial Data Exfiltration" `
    -EndpointDlpRestrictions @(
        @{Setting = "CopyToRemovableMedia"; Value = "Warn"},
        @{Setting = "CloudAppEgress"; Value = "Block"},
        @{Setting = "Print"; Value = "Audit"},
        @{Setting = "CopyToClipboard"; Value = "Audit"},
        @{Setting = "BluetoothTransfer"; Value = "Block"}
    )

# Review all current rules and their exception configuration
Get-DlpComplianceRule -Policy "Protect Financial Data on Endpoints" |
    Select-Object Name, ExceptIfFrom, ExceptIfContentPropertyContainsWords,
    ContentContainsSensitiveInformation |
    Format-List
💡 Pro Tip: Set a calendar reminder to review DLP exceptions every 90 days. Exceptions without expiry dates tend to accumulate, gradually weakening your DLP posture. Require re-justification at each review cycle.

Summary

What You Accomplished

  • Verified Endpoint DLP prerequisites and configured endpoint settings
  • Created DLP policies for USB, print, clipboard, and cloud upload activities
  • Configured user notifications with override and business justification
  • Tested policies and monitored alerts in Defender XDR
  • Investigated endpoint DLP incidents with unified device timeline

Next Steps

πŸ“š Documentation Resources

ResourceDescription
Endpoint DLP OverviewLearn about Endpoint DLP capabilities, requirements, and supported activities
Get Started with Endpoint DLPStep-by-step guide to enable and configure Endpoint DLP
Endpoint DLP SettingsConfigure global settings: unallowed apps, Bluetooth, browser restrictions
Create a DLP PolicyComplete guide to creating and deploying DLP policies
DLP Policy ReferencePowerShell cmdlets for DLP compliance policies and rules
Activity ExplorerMonitor and review DLP matches, overrides, and false positives
DLP Alerts in Defender XDRInvestigate DLP alerts in the unified Defender XDR portal
Advanced Hunting for DLPKQL queries for hunting DLP events in DeviceEvents and AlertInfo