Tasks Retention Tag – PowerShell Only

Migrations from Exchange On-Premises to Exchange Online can be complex if you are new to the process. Knowing what translates and what does not when it comes to the migration process can be extremely helpful. For Example, there are certain items in Exchange that need to be recreated in Exchange Online in order for functionality to translate – Transport Rules, Retention Policies/Tags and Journal rules all need to be recreated in Exchange Online. The one I want to review in particular here is Retention Policies.

If the intent is to continue using the existing Retention Policies and Tags in Office 365, then these will need to be duplicated. If the tags and policies are not duplicated, then the old tags will not apply and will eventually be removed. To prevent this disconnect during a migration, it is imperative that the tags and policies for retention are copied prior to any mailbox moves. The easiest way to do this is to have both the on-premises console for your Exchange servers up and also have a browser logged into your Exchange Online tenant. With that you should be able to copy and paste the names of custom tags, or custom policies and then verify everything looks good.

The problem is that apparently not all of the tag options are available in the GUI. In particular, Tasks is not visible in the selectable list of known folders:

Select ‘Applied automatically to a default folder’ and then when you review the list of folders available: (below screenshot)

You see that the Task folder is not an option. This has held true since at least Exchange 2010.

How to add it in PowerShell

Now if you need to create this tag in Office 365, you will have to do so in PowerShell. First, connect to your Office 365 tenant via PowerShell using these instructions:

How to Connect to Exchange Online

Once connected, we need to figure out what the correct syntax would be.

Get-Help New-RetentionPolicyTag -Full

That cmdlet will reveal all the options as well as some examples at the bottom:
From this we can assemble the syntax we need to create the appropriate tag. In this case, I need a tag that will protect the tag from being processed. Which will require the setting of RetentionEnabled to False:

New-RetentionPolicyTag -Type tasks -Name Tasks -RetentionAction DeleteAndAllowRecovery -RetentionEnabled $False

Now if we review the Retention Policy Tags available in Office 365, we see this:

We can also validate the settings with PowerShell:

Conclusion

The key thing about the process above is that even though we are creating the tag via PowerShell, as long as we match the details (name, type, etc.) then the tag will still work for the mailbox when it is moved to Office 365. So for tags you cannot duplicate in the EAC for Exchange Online, use PowerShell instead.

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s