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.
Power Shell
Connect to MSOnline Power Shell Module
Connect-MsolService
Create a new retention tag
New-RetentionPolicyTag "Tag Name" -Type
New Retention Policy
New-RetentionPolicy
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