Set Retention Policies in Office 365 via PowerShell

Below is a list of useful commands we can use to view set retention policies on Office 365 mailboxes through Azure AD PowerShell.  Again, we will need to connect to the tenant using the Azure AD PowerShell module to make the setting changes.

These same commands can be used within an Exchange 2013 environment as well.


List all of the currently available retention policies and assigned retention tags…

Get-RetentionPolicy | ft -auto Name,RetentionPolicyTagLinks


List a retention policy currently set for an individual mailbox…

Get-Mailbox -Identity "USER_ALIAS" | ft Alias,RetentionPolicy


Get the list of retention policies set on all O365 mailboxes…

Get-Mailbox -ResultSize Unlimited | ft -auto Alias,RetentionPolicy


Set a retention policy for an individual O365 mailbox…

Set-Mailbox -Identity "USER_ALIAS" -RetentionPolicy "RETENTION_POLICY_NAME"


Set a retention policy on all O365 mailboxes…

Get-Mailbox -ResultSize Unlimited | Set-Mailbox -RetentionPolicy "RETENTION_POLICY_NAME"


Remove a retention policy from an individual mailbox…

Set-Mailbox -Identity "USER_ALIAS" -RetentionPolicy $null


Set an existing retention policy as the default retention policy for your organization.  This may or may not set the assigned policy permanently as the “IsDefault” parameter is reserved for internal Microsoft use. The default retention policy name in Exchange and Exchange Online is “Default MRM Policy“.

Set-RetentionPolicy -Identity "RETENTION_POLICY_NAME" -IsDefault:$True


Related Articles in this Blog:





5 thoughts on “Set Retention Policies in Office 365 via PowerShell

  1. Pingback: Comment réussir l’examen « Enabling Office 365 Services (70-347) » – Bienvenue à bord d'Air Cloud !

  2. Pingback: Manage Retention Policy and Tags by using PowerShell | Office 365 -

  3. Pingback: Study Guide for Microsoft Exam 70-347 - Enabling Office 365 Services (Part 2 of 2) - Platform Scholar

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s