Commands › Exchange Online
Set-RetentionPolicyTag
Modify the properties of a retention tag. For more information about retention tags, see Retention tags and retention policies in Exchange Server.
Quick start script
# Set-RetentionPolicyTag — 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-RetentionPolicyTag
$before | Format-List
# 3. Make the change (dry run first)
Set-RetentionPolicyTag -Identity <RetentionPolicyTagIdParameter> -Mailbox <MailboxIdParameter> -WhatIf
Set-RetentionPolicyTag -Identity <RetentionPolicyTagIdParameter> -Mailbox <MailboxIdParameter>
# 4. Verify and diff
$after = Get-RetentionPolicyTag
Compare-Object ($before | Out-String) ($after | Out-String)
Syntax — 2 parameter sets
Identity
Set-RetentionPolicyTag [-Identity] <RetentionPolicyTagIdParameter>
[-AddressForJournaling <RecipientIdParameter>]
[-AgeLimitForRetention <EnhancedTimeSpan>]
[-Comment <String>]
[-Confirm]
[-DomainController <Fqdn>]
[-Force]
[-JournalingEnabled <Boolean>]
[-LabelForJournaling <String>]
[-LegacyManagedFolder <ELCFolderIdParameter>]
[-LocalizedComment <MultiValuedProperty>]
[-LocalizedRetentionPolicyTagName <MultiValuedProperty>]
[-MessageClass <String>]
[-MessageFormatForJournaling <JournalingFormat>]
[-MustDisplayCommentEnabled <Boolean>]
[-Name <String>]
[-RetentionAction <RetentionAction>]
[-RetentionEnabled <Boolean>]
[-RetentionId <Guid>]
[-SystemTag <Boolean>]
[-WhatIf]
[<CommonParameters>]
MailboxTask
Set-RetentionPolicyTag -Mailbox <MailboxIdParameter>
[-Comment <String>]
[-Confirm]
[-DomainController <Fqdn>]
[-Force]
[-LegacyManagedFolder <ELCFolderIdParameter>]
[-LocalizedComment <MultiValuedProperty>]
[-LocalizedRetentionPolicyTagName <MultiValuedProperty>]
[-MustDisplayCommentEnabled <Boolean>]
[-Name <String>]
[-OptionalInMailbox <RetentionPolicyTagIdParameter[]>]
[-RetentionId <Guid>]
[-SystemTag <Boolean>]
[-WhatIf]
[<CommonParameters>]
Parameters (23)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.