All scripts
Governance 418
Get-SharePointRetentionLabelReport
Reports which retention labels are published to which SharePoint sites, so you can confirm compliance labels reached the sites they were meant to before relying on them.
Get-SharePointRetentionLabelReport.ps1
<#
.SYNOPSIS
Reports retention label publishing across SharePoint sites.
.DESCRIPTION
Lists retention label policies and the sites they are published to,
so you can confirm compliance labels actually reached their intended
sites rather than assuming the publish succeeded.
.EXAMPLE
.\Get-SharePointRetentionLabelReport.ps1
.NOTES
Requires the ExchangeOnlineManagement module connected to Security &
Compliance PowerShell (Connect-IPPSSession).
.AUTHOR
Shehryar Hassan
#>
$policies = Get-RetentionCompliancePolicy | Where-Object { $_.SharePointLocation }
$report = foreach ($policy in $policies) {
[pscustomobject]@{
PolicyName = $policy.Name
Enabled = $policy.Enabled
Sites = ($policy.SharePointLocation -join "; ")
Mode = $policy.Mode
}
}
$report | Format-Table -AutoSize
Read it before you run it, and test in a safe tenant first.