Governing Microsoft Purview Priority Cleanup Hard Delete & DLP View-Only Roles for Copilot Data Hygiene (PowerShell Runbook)

✨ December 2026 Purview & Copilot Hygiene Brief
  • Priority Cleanup Hard Delete (SharePoint & OneDrive): Rolling out in December 2026, Microsoft Purview Data Lifecycle Management lets admins permanently purge targeted SharePoint and OneDrive files—bypassing Recycle Bins and overriding active retention policies or Preservation Hold Libraries—so Microsoft 365 Copilot stops grounding on stale or overshared data.
  • Least-Privilege Endpoint DLP Auditing: The new View-Only Device Management role lets SOC analysts and compliance auditors inspect Purview Endpoint DLP device onboarding status and export inventories without write permissions.
  • Defender for Cloud Apps File Policies Transition: Map legacy Defender for Cloud Apps (MDA) File Policies to native Microsoft Purview DLP ahead of upcoming retirement milestones.

One of the hardest problems in enterprise Microsoft 365 Copilot rollouts is retention-induced data sprawl. Broad 5-year or 7-year Purview retention policies protect organizations from accidental deletion, but they also trap obsolete HR spreadsheets, stale M&A drafts, and ex-employee OneDrive files inside SharePoint and Preservation Hold Libraries—where Copilot and Copilot Studio agents can still surface them if permissions are overly broad.

In December 2026, Microsoft Purview introduces hard delete support in Priority Cleanup policies for SharePoint and OneDrive alongside a new least-privilege View-Only Device Management role for Endpoint DLP. This runbook walks through the governance architecture, multi-person approval guardrails, and PowerShell scripts to audit your retention policies, DLP role assignments, and Defender for Cloud Apps migration readiness.


Architecture: Priority Cleanup Hard Delete & Copilot Data Hygiene

1. Retention-Locked Risk • Stale SPO / OneDrive Files • Active Retention Policies • Preservation Hold Library Copilot Grounding Exposure 2. Priority Cleanup Policy • Adaptive / Static Scopes • Multi-Person Approval • Retention + eDiscovery Sign-off Hard Delete Mode Enabled 3. Permanent Purge • Overrides Retention • Bypasses Recycle Bin • Logged in Purview Audit Irreversible Deletion 4. Clean Grounding âś” Reduced Oversharing âś” Accurate Copilot âś” Lower SPO Storage DLP View-Only Audit Mandatory Governance Guardrails Before Running Hard Delete 1. Always run in Simulation Mode first  |  2. Require dual approval (Retention + eDiscovery Manager)  |  3. Export Unified Audit Log evidence for CAB

1. What Changed in Purview Priority Cleanup (Hard Delete Mode)

Previously, Priority Cleanup focused primarily on Exchange Online mailboxes and standard deletion workflows. With the December 2026 update for SharePoint and OneDrive:

  • Bypasses Recycle Bins: Selecting Hard Delete permanently removes matched files immediately rather than moving them to the first-stage or second-stage SharePoint Recycle Bin.
  • Overrides Retention & Holds: Authorized Priority Cleanup policies can override active retention policies and remove items stuck in the Preservation Hold Library (for example, retired Teams meeting recordings, stale regulatory exports, or departed user OneDrive sites).
  • Mandatory Multi-Person Approval: Because hard delete is irreversible, Microsoft enforces a strict approval chain (typically requiring distinct Retention Management and eDiscovery Administrator approvers) before execution begins.

Why This Directly Protects Microsoft 365 Copilot

Even when you apply SharePoint Advanced Management (SAM) Restricted Access Control (RAC) or Purview DLP for Copilot, legacy files sitting under blanket 7-year retention policies continue to consume SharePoint storage and pollute Semantic Index recall for users who still have site membership. Priority Cleanup Hard Delete gives compliance teams a surgical, auditable mechanism to eliminate toxic or expired datasets cleanly.

2. Auditing Retention Policies & DLP Role Posture via PowerShell

Before creating a Priority Cleanup policy or delegating the new View-Only Device Management DLP role, audit your current Microsoft Purview compliance policies and role groups using Security & Compliance PowerShell (Connect-IPPSSession via modern App-Only Certificate Auth or interactive MFA).

POWERSHELL
#Requires -Modules ExchangeOnlineManagement
<#
.SYNOPSIS
    Audits Microsoft Purview Retention Policies, DLP Policies, and Endpoint DLP Role Groups
    ahead of Priority Cleanup Hard Delete and DLP View-Only Device Management delegation.
#>

param(
    [Parameter(Mandatory)]
    [string]$Organization,

    [string]$AppId,
    [string]$CertificateThumbprint,
    [string]$OutputFolder = ".\Purview-Hygiene-Audit"
)

$ErrorActionPreference = "Stop"
if (-not (Test-Path $OutputFolder)) { New-Item -ItemType Directory -Path $OutputFolder | Out-Null }

# Connect to Security & Compliance PowerShell (Certificate Auth or Interactive)
if ($AppId -and $CertificateThumbprint) {
    Connect-IPPSSession -AppId $AppId -CertificateThumbprint $CertificateThumbprint -Organization $Organization -ShowBanner:$false
} else {
    Connect-IPPSSession -Organization $Organization -ShowBanner:$false
}

Write-Host "[1/3] Auditing Purview Retention Policies targeting SharePoint & OneDrive..." -ForegroundColor Cyan
$RetentionPolicies = Get-RetentionCompliancePolicy -DistributionDetail | ForEach-Object {
    [PSCustomObject]@{
        PolicyName         = $_.Name
        Enabled            = $_.Enabled
        Mode               = $_.Mode
        SharePointLocation = ($_.SharePointLocation.Name -join "; ")
        OneDriveLocation   = ($_.OneDriveLocation.Name -join "; ")
        RestrictiveHold    = $_.RestrictiveRetention
        WhenChangedUTC     = $_.WhenChangedUTC
    }
}
$RetentionPolicies | Export-Csv -Path (Join-Path $OutputFolder "RetentionPolicies-SPO-ODB.csv") -NoTypeInformation
Write-Host "  Exported $($RetentionPolicies.Count) retention policies." -ForegroundColor Green

Write-Host "[2/3] Auditing Purview DLP Policies (Checking MDA File Policy Migration Coverage)..." -ForegroundColor Cyan
$DlpPolicies = Get-DlpCompliancePolicy | ForEach-Object {
    [PSCustomObject]@{
        PolicyName         = $_.Name
        Mode               = $_.Mode
        Enabled            = $_.Enabled
        Workload           = $_.Workload
        Priority           = $_.Priority
        WhenChangedUTC     = $_.WhenChangedUTC
    }
}
$DlpPolicies | Export-Csv -Path (Join-Path $OutputFolder "DlpPolicies-Inventory.csv") -NoTypeInformation
Write-Host "  Exported $($DlpPolicies.Count) DLP policies." -ForegroundColor Green

Write-Host "[3/3] Auditing Purview Role Groups for Least-Privilege DLP & Retention Approvers..." -ForegroundColor Cyan
$TargetRoles = @(
    "Compliance Administrator",
    "Data Loss Prevention",
    "Records Management",
    "eDiscovery Manager",
    "Organization Management"
)

$RoleAudit = foreach ($RoleName in $TargetRoles) {
    $Group = Get-RoleGroup -Identity $RoleName -ErrorAction SilentlyContinue
    if ($Group) {
        $Members = Get-RoleGroupMember -Identity $RoleName -ErrorAction SilentlyContinue
        [PSCustomObject]@{
            RoleGroup   = $Group.Name
            MemberCount = @($Members).Count
            Members     = ($Members.PrimarySmtpAddress -join "; ")
        }
    }
}
$RoleAudit | Export-Csv -Path (Join-Path $OutputFolder "Purview-RoleGroups-Audit.csv") -NoTypeInformation
$RoleAudit | Format-Table -AutoSize

Disconnect-ExchangeOnline -Confirm:$false -ErrorAction SilentlyContinue
Write-Host "`n[+] Purview audit complete. Reports saved to $OutputFolder" -ForegroundColor Green

3. Assigning the New DLP View-Only Device Management Role

Historically, giving a SOC analyst or IT auditor visibility into Microsoft Purview > Settings > Device onboarding required assigning broader DLP or Compliance Administrator permissions—violating least-privilege principles.

With the new View-Only Device Management role in Microsoft Purview:

  1. Open the Microsoft Purview portal → Settings → Roles and scopes → Role groups.
  2. Create a custom role group (e.g., Purview-Endpoint-DLP-Auditors).
  3. Add the View-Only Device Management role.
  4. Assign your SOC Tier-1 / Audit Entra ID security group (preferably backed by Entra PIM for time-bound elevation).
  5. Verify that members can view device onboarding status, search endpoints, and export device CSV reports, while all configuration edit/offboarding buttons remain disabled.

4. Migration Checklist: Defender for Cloud Apps File Policies → Purview DLP

Microsoft is actively notifying tenants via Message Center to retire legacy Microsoft Defender for Cloud Apps (MDA) File Policies in favor of unified Microsoft Purview DLP policies. Use this 4-step transition checklist:

Legacy MDA File Policy ControlNative Microsoft Purview EquivalentVerification Action
External sharing detection on SharePoint / OneDrivePurview DLP Policy (SharePoint & OneDrive locations + Sensitive Info Types)Run in Simulation mode for 14 days before switching to Enforce.
Auto-apply sensitivity label on matchPurview Auto-Labeling Policy (Service-side SharePoint/OneDrive)Confirm E5 / Purview Information Protection licensing coverage.
Governance action: Quarantine / Remove external linkDLP Policy Action: Restrict access or encrypt content for external usersValidate exceptions for approved B2B partner domains.
Alerting & SOC triageMicrosoft Defender XDR Unified Incident Queue (Purview DLP alerts)Disable duplicate MDA File Policy once Purview DLP alerts flow cleanly.


References & Official Microsoft Documentation

đź’¬ Reader Comments & Feedback

Did this runbook help, or did Microsoft change a cmdlet or UI menu? Share your feedback below.