All scripts
Governance 320
Get-PowerPlatformDlpPolicyReport
Reports every Power Platform data loss prevention policy and which connectors it classifies as business, non business, or blocked, so DLP coverage can be verified environment by environment.
Get-PowerPlatformDlpPolicyReport.ps1
<#
.SYNOPSIS
Reports Power Platform DLP policies and connector classifications.
.DESCRIPTION
Lists every data loss prevention policy in the Power Platform admin
center with its connector classifications and the environments it
applies to, so DLP coverage can be verified rather than assumed
consistent across environments.
.EXAMPLE
.\Get-PowerPlatformDlpPolicyReport.ps1
.NOTES
Requires the Microsoft.PowerApps.Administration.PowerShell module and
an active Add-PowerAppsAccount session.
.AUTHOR
Shehryar Hassan
#>
$policies = Get-DlpPolicy
$report = foreach ($policy in $policies) {
[pscustomobject]@{
PolicyName = $policy.DisplayName
Scope = $policy.EnvironmentType
BusinessCount = $policy.ConnectorGroups | Where-Object Classification -eq "Business" | Measure-Object | Select-Object -ExpandProperty Count
BlockedCount = $policy.ConnectorGroups | Where-Object Classification -eq "Blocked" | Measure-Object | Select-Object -ExpandProperty Count
}
}
$report | Format-Table -AutoSize
Read it before you run it, and test in a safe tenant first.