Commands › Exchange Online
Set-LabelPolicy
This cmdlet is functional only in Security & Compliance PowerShell. For more information, see Security & Compliance PowerShell. Use the Set-Label cmdlet to modify sensitivity label policies in your organization.
Quick start script
# Set-LabelPolicy — 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-LabelPolicy
$before | Format-List
# 3. Make the change (dry run first)
Set-LabelPolicy -Identity <PolicyIdParameter> -RetryDistribution <SwitchParameter> -WhatIf
Set-LabelPolicy -Identity <PolicyIdParameter> -RetryDistribution <SwitchParameter>
# 4. Verify and diff
$after = Get-LabelPolicy
Compare-Object ($before | Out-String) ($after | Out-String)
Syntax — 3 parameter sets
RetryDistribution
Set-LabelPolicy [-Identity] <PolicyIdParameter> -RetryDistribution
[-AddLabels <MultiValuedProperty>]
[-AdvancedSettings <PswsHashtable>]
[-Confirm]
[-MigrationId <String>]
[-NextLabelPolicy <PolicyIdParameter>]
[-PreviousLabelPolicy <PolicyIdParameter>]
[-RemoveLabels <MultiValuedProperty>]
[<CommonParameters>]
Identity
Set-LabelPolicy [-Identity] <PolicyIdParameter>
[-AddExchangeLocation <MultiValuedProperty>]
[-AddExchangeLocationException <MultiValuedProperty>]
[-AddLabels <MultiValuedProperty>]
[-AddModernGroupLocation <MultiValuedProperty>]
[-AddModernGroupLocationException <MultiValuedProperty>]
[-AddOneDriveLocation <MultiValuedProperty>]
[-AddOneDriveLocationException <MultiValuedProperty>]
[-AddPublicFolderLocation <MultiValuedProperty>]
[-AddSharePointLocation <MultiValuedProperty>]
[-AddSharePointLocationException <MultiValuedProperty>]
[-AddSkypeLocation <MultiValuedProperty>]
[-AddSkypeLocationException <MultiValuedProperty>]
[-AdvancedSettings <PswsHashtable>]
[-Comment <String>]
[-Confirm]
[-ExchangeAdaptiveScopes <MultiValuedProperty>]
[-ExchangeAdaptiveScopesException <MultiValuedProperty>]
[-MigrationId <String>]
[-NextLabelPolicy <PolicyIdParameter>]
[-PolicyRBACScopes <MultiValuedProperty>]
[-RemoveExchangeLocation <MultiValuedProperty>]
[-RemoveExchangeLocationException <MultiValuedProperty>]
[-RemoveLabels <MultiValuedProperty>]
[-RemoveModernGroupLocation <MultiValuedProperty>]
[-RemoveModernGroupLocationException <MultiValuedProperty>]
[-RemoveOneDriveLocation <MultiValuedProperty>]
[-RemoveOneDriveLocationException <MultiValuedProperty>]
[-RemovePublicFolderLocation <MultiValuedProperty>]
[-RemoveSharePointLocation <MultiValuedProperty>]
[-RemoveSharePointLocationException <MultiValuedProperty>]
[-RemoveSkypeLocation <MultiValuedProperty>]
[-RemoveSkypeLocationException <MultiValuedProperty>]
[<CommonParameters>]
AdaptiveScopeLocation
Set-LabelPolicy [-Identity] <PolicyIdParameter>
[-AddLabels <MultiValuedProperty>]
[-AdvancedSettings <PswsHashtable>]
[-Comment <String>]
[-Confirm]
[-Force]
[-MigrationId <String>]
[-NextLabelPolicy <PolicyIdParameter>]
[-PreviousLabelPolicy <PolicyIdParameter>]
[-RemoveLabels <MultiValuedProperty>]
[-Setting <PswsHashtable>]
[-Settings <PswsHashtable>]
[-WhatIf]
[<CommonParameters>]
Parameters (39)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.