An Engineers Notebook

Office 365: Retention Tags and Policies

Retention Tag Types

  • Default policy tags – Automatically applied to an entire mailbox which has no other tags set.
  • Retention policy tags – Are applied to the default folders like ‘Inbox’ and ‘Calendar’.
  • Personal Tags – Set manually through user assignments to both messages and folders.
Retention tags are linked to a retention policy and then the policy is linked to user mailboxes.

Power Shell

Connect to MSOnline Power Shell Module


Create a new retention tag

New-RetentionPolicyTag "Tag Name" -Type -AgeLimitForRetention -RetentionAction

New Retention Policy

New-RetentionPolicy -RetentionPolicyTagLinks

Change Policy for all Mailboxes

Get-Mailbox -ResultSize unlimited | Set-Mailbox -RetentionPolicy "RetentionPolicyName"

Change old retention policy to new one

$OldPolicy = {Get-RetentionPolicy "Old-Retention-Policy"}.distinguishedName
Get-Mailbox -Filter {RetentionPolicy -eq $OldPolicy} -Resultsize Unlimited | Set-Mailbox -RetentionPolicy "New-Retention-Policy"

How do we know it worked?

Get-Mailbox "Mailbox Name" | Select-RetentionPolicy

If we need to force the retention process to run for some reason this can be done with a power shell command only. The process which does the retention actions is called the ‘Managed Folder Assistant’ and is run periodically by default.

Start-ManagedFolderAssistant -Identity "Username"

Place a mailbox on retention hold

Set-Mailbox "Username" -RetentionHoldEnabled $true

Leave a Reply

Your email address will not be published.