Commands › Exchange Online
Get-ComplianceRetentionEvent
For more information, see Security & Compliance PowerShell. Use the Get-ComplianceRetentionEvent cmdlet to view compliance retention events in the Microsoft Purview compliance portal.
Quick start script
# Get-ComplianceRetentionEvent — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org
# 2. Run and inspect
Get-ComplianceRetentionEvent | Format-List
# 3. Export for evidence / drift tracking
Get-ComplianceRetentionEvent | Export-Clixml .\ComplianceRetentionEvent-$(Get-Date -Format yyyyMMdd).xml
Syntax
Get-ComplianceRetentionEvent [-Identity <PolicyIdParameter>]
[-BeginDateTime <System.DateTime>]
[-DomainController <Fqdn>]
[-EndDateTime <System.DateTime>]
[-PreviewOnly]
[<CommonParameters>]
Parameters (5)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.