Commands › Exchange Online
New-AppRetentionCompliancePolicy
For more information, see Security & Compliance PowerShell. Use the New-AppRetentionCompliancePolicy to create app retention compliance policies. App retention & labeling policies target new ways to scope and manage policies.
Quick start script
# New-AppRetentionCompliancePolicy — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org
# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-AppRetentionCompliancePolicy
$before | Format-List
# 3. Make the change (dry run first)
New-AppRetentionCompliancePolicy -Name <String> -AdaptiveScopeLocation <MultiValuedProperty> -Applications <String[]> -WhatIf
New-AppRetentionCompliancePolicy -Name <String> -AdaptiveScopeLocation <MultiValuedProperty> -Applications <String[]>
# 4. Verify and diff
$after = Get-AppRetentionCompliancePolicy
Compare-Object ($before | Out-String) ($after | Out-String)
Syntax — 2 parameter sets
AdaptiveScopeLocation
New-AppRetentionCompliancePolicy [-Name] <String> -AdaptiveScopeLocation <MultiValuedProperty> -Applications <String[]>
[-Confirm]
[-Comment <String>]
[-Enabled <Boolean>]
[-Force]
[-RestrictiveRetention <Boolean>]
[-WhatIf]
[<CommonParameters>]
Default
New-AppRetentionCompliancePolicy [-Name] <String> -Applications <String[]>
[-Comment <String>]
[-Confirm]
[-Enabled <Boolean>]
[-ExchangeLocation <MultiValuedProperty>]
[-ExchangeLocationException <MultiValuedProperty>]
[-Force]
[-ModernGroupLocation <MultiValuedProperty>]
[-ModernGroupLocationException <MultiValuedProperty>]
[-PolicyRBACScopes <MultiValuedProperty>]
[-RestrictiveRetention <Boolean>]
[-WhatIf]
[<CommonParameters>]
Parameters (14)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.