03 September 2014

How To Enable Message Retension Policy on Exchange 2010

By default all databases servers can be chosen by automatic mailbox distribution to store a new or moved mailbox.
To disable this feature using the following procedure.

To exclude a single database:
Set-MailboxDatabase -Identity ArchiveDB01 -IsExcludedFromProvisioning $true

View and set Managed Folder Assistant:
Get-MailboxServer | Format-Table Name,ManagedFolderWorkCycle* -Auto
Set-MailboxServer MyMailboxServer -ManagedFolderWorkCycle 1

Tip: Enable don’t permanently delete items until the database has been backed up, via mailbox DB proprieties.

Create a new retention policy:
New-RetentionPolicyTag "Test Mailbox 30 days" -Type All -Comment "All Mailbox elements move to archive in 30 days" -RetentionEnabled $true -AgeLimitForRetention 30 -RetentionAction MovetoArchive

New-RetentionPolicy "Test Managed Folders Retention Policy" -RetentionPolicyTagLinks "Test Mailbox 30 days"

If you don’t want Calendar and Tasks items to ever expire, you can disable the functionality  (included in Exchange 2010 SP2 RU4).
Add the following registry key to your Mailbox servers:
    Path: HKLM\SYSTEM\CurrentControlSet\Services\MSExchangeMailboxAssistants\Parameters
    Name: ELCAssistantCalendarTaskRetentionEnabled
    Type: DWORD
    Value: 0 = Do not process Calendar and Task folders
    Value: 1 = Process (default with RU4)

If you want Calendar and Tasks folders to expire at a different interval than Default Policy Tag, you can follow these steps:
    Place all mailboxes on Retention Hold
    Apply Exchange 2010 SP2 RU4

    Create RPTs for Calendar and Tasks folders with the custom retention settings.
    Remove the retention hold from mailboxes.

Do not forget to exclude notes from archiving with a custom tag.

Now apply the policy to a test user using EMC.

Force policy run:
Start-ManagedFolderAssistant -Identity “user”

Applying retention policies to a distribution group of mailboxes:
Get-DistributionGroupMember -Identity "Test Distribution List" | Set-Mailbox -RetentionPolicy "Test Managed Folders Retention Policy"