Enabling Archives and Retention Policies in Office 365

I’ve spent a few days working on email archives in Office 365 as we want to enable this function for all users. I had a few interesting discoveries so I thought I would share them.

The first was over retention policies, this allows you to specify rules for automatically archiving or deleting mail from the inbox and other folders. I was surprised this functionality wasn’t enabled by default so I started working on turning it on.

During my initial tests I had been unable to have retention policies appear for users despite having assigned them a policy and having active retention tags. From my investigations it appears there are a number of things to consider in this situation, firstly it appears only users with archives can apply the default retention policy. In this instance enabling the archive turns on the default retention policy automatically. The second thing to consider appears to be a delay in this setting processing, I’d tried enabling and changing a number of settings but saw no changes until I left this system overnight. This is likely similar to the delay on global address list changes that run once a day.

I’ve since found a powershell command to manually force a refresh of the retention policies:

$UserMailboxes = Get-mailbox -Filter {(RecipientTypeDetails -eq ‘UserMailbox’)}
$UserMailboxes | ForEach {Start-ManagedFolderAssistant $_.Identity

I’d found a helpful guide here but it didn’t cover how to enable archives for all users. As we are using Dirsync I didn’t want to have to manually enter each and every user account and enable the archive function. After a lot of digging around I found this powershell to enable archives for all users:

Get-Mailbox -ResultSize unlimited -Filter {(RecipientTypeDetails -eq ‘UserMailbox’)} | Enable-Mailbox -Archive

Unfortunately I can’t find a way to automatically set it so new users are provisioned with a archive so instead we’ll have to script it to run this command on a regular basis while we are still creating new accounts.

About Stuart Gould

IT Services Senior Infrastructure Solutions Specialist.
Microsoft Certified Solutions Expert: Private Cloud,
MCSE: Windows Server 2003,
MCSA: Windows Server 2012, Windows Server 2008, Window Server 2003, Windows 7

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *