Using Office 365 Retention Policy

Microsoft (Office 365) retention policies make it easy for the user and administrator to clean up and archive items in a user’s mailbox on Exchange Online. Retention policies allow to automatically assign some trigger action for an item after a certain period (for instance, move the item to the archive mailbox or delete it permanently). Microsoft 365 retention policies can be used to automatically remove email items older than a specified date from a user’s mailbox. By default, retention policies apply to the Deleted Items and Junk Mail folders to automatically remove items that are older than 30 days.

Applying Retention and Archive Policies in Outlook Web App

By default, retention policies do not apply to other folders in the inbox (except for Deleted Items and Junk). However, the user can manually set retention tags for certain folders. For example, a user wants to automatically delete old messages from the Newsletter folder after one year. He can manually set the Retention/Archiving Tags for email items in Office 365 mailbox.

  1. Sign in to your Microsoft (Office) 365 account;
  2. Select Outlook in the App Launcher;
    office 365 retention policy
  3. In the interface of your mailbox, right-click on the folder or email message for which you want to change Retention/Archive settings;
  4. Select an archive policy or retention label from the list. Keep in mind that by default the Retention policy settings are inherited from the parent folder (Use parent folder policy);
    default retention policy office 365

If none of the default retention policies suits you, then create your own custom retention policies with the parameters you need:

  1. Select Settings > Mail > Retention policies;
  2. Click the Add new policy button and create your own custom retention policy with the parameters you need;
    retention policy office 365
  3. After that, you can apply your custom retention policy to the required items in the Inbox folder of the Office 365 mailbox.

Note. Note that Exchange Online calendar items are not retained.

How to Create a Microsoft 365 Retention Policy using Microsoft 365 Admin Center?

The Microsoft (Office) 365 administrator can create custom Retention tags and Retention Policies and assign them to user mailboxes.

  1. To to use some Retention Policies, you need to enable users’ archive mailboxes. Go to the Microsoft 365 Admin Center;
  2. Select the user mailboxes for which you want to enable archive mailbox, go to the Mail tab, and click Edit Exchange Properties; o365 retention policy
  3. Go to the mailbox feature tab and enable the Archiving option; change default retention policy office 365
  4. Now go to the Exchange Admin Center > Compliance manager > Retention tags;
  5. Create a new Retention Tag with the required parameters (+ > select applied automatically to the entire mailbox). For example, we have created a tag named “3 Year move to archive”, Retention action > Move to archive; Retention period > when the item reaches the following age (in days) > 1095;
    office 365 email retention policy
  6. Then go to Exchange Admin Center > Compliance Management > Retention Policies. Press the + button;
  7. Name the Retention Policy and add retention tags you want to apply to user mailboxes;set retention policy office 365
  8. Then you need to assign the policy to User Mailboxes. Go to Exchange Admin Center > Recipients > Mailboxes. Select the mailboxes for which you want to apply policies, click More options > Update for Retention Policy. In the drop-down list of the Bulk Assign Retention Policy form, select a new retention policy you created earlier;
    exchange 365 retention policy

Managing Retention Policies in Microsoft 365 with PowerShell

You can manage your Microsoft 365 retention policies using PowerShell. To do this, install the Exchange Online PowerShell v2 (EXO V2):

Import-Module ExchangeOnlineManagement

Connect to the Microsoft 365 Security and Compliance Center:

Connect-IPPSSession -UserPrincipalName admin@theitbros.com

To create a new retention tag, use the New-ComplianceTag cmdlet:

New-ComplianceTag -Name "WORD docs" -RetentionAction Keep -RetentionDuration 730 -RetentionType ModificationAgeInDays 

In this example, we have set three retention tag options:

  • RetentionAction — specifies the action for the label (Delete, Keep, KeepAndDelete);
  • RetentionType — specifies how to calculate the retention duration from the content creation date, tagged date, or last modification date (CreationAgeInDays, EventAgeInDays, TaggedAgeInDays, ModificationAgeInDays);
  • RetentionDuration — the number of days to retain the content (2 years or 730 days in this case).

email retention policy office 365

You can list your custom retention tags (labels) with the command:

Get-ComplianceTag|Format-Table

In order to create a new retention policy for Exchange Online mailboxes, use the New-RetentionCompliancePolicy cmdlet:

New-RetentionCompliancePolicy -Name "Word Docs" -ExchangeLocation All

If you need to create a Retention policy only for certain user mailboxes:

New-RetentionCompliancePolicy -Name "Word Docs" -ExchangeLocation "j.brion@theitbros.com","m.berg@theitbros.com"

Now you can create a retention compliance rule that links your retention tag and retention policy:

New-RetentionComplianceRule -Policy "Word Docs" -ApplyComplianceTag "Word docs" -ContentMatchQuery “filetype:docx”

In this case, in the ContentMatchQuery parameter, we have specified a rule or query that will be used to filter the elements to be saved. The Keyword Query Language (KQL) syntax is used in a query.

office 365 archive policy

I enjoy technology and developing websites. Since 2012 I'm running a few of my own websites, and share useful content on gadgets, PC administration and website promotion.
Cyril Kardashevsky

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.