Windows 2025
Sponsored Link

Exchange Server 2019 : Set Retension Policies2025/01/15

 

Set Retension Policies to users' mailbox.
Messages in mailbox Retension Policies applied are moved or deleted automatically.

If you like to set [Move To Archive] policy, it needs to enable In-Place Archive folder beforehand.

[1] Run PowerShell with Admin Privilege and configure it.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\Windows\system32> LaunchEMS 

# default retension policies
[PS] C:\Users\exchangeadmin> Get-RetentionPolicy 

Name                      RetentionPolicyTagLinks              Guid
----                      -----------------------              ----
Default MRM Policy        {Recoverable Items 14 days move to   c4ca90d1-b613-4294-a344-a12df088254
                          archive, Never Delete, 5 Year        5
                          Delete, 1 Year Delete, 6 Month
                          Delete, 1 Month Delete, 1 Week
                          Delete, Personal never move to
                          archive, Personal 5 year move to
                          archive, Default 2 year move to
                          archive, Personal 1 year move to
                          archive}
ArbitrationMailbox        {Never Delete,                       29e4e2b5-4852-4df1-ae09-366f3e053bc
                          AsyncOperationNotification,          4
                          ModeratedRecipients, AutoGroup}

# default retension policy tags
[PS] C:\Users\exchangeadmin> Get-RetentionPolicyTag | Format-Table -AutoSize -Wrap 

Name                                      Type             Description
----                                      ----             -----------
Personal 1 year move to archive           Personal         Managed Content Settings
Default 2 year move to archive            All              Managed Content Settings
Personal 5 year move to archive           Personal         Managed Content Settings
Personal never move to archive            Personal         Managed Content Settings
1 Week Delete                             Personal         Managed Content Settings
1 Month Delete                            Personal         Managed Content Settings
6 Month Delete                            Personal         Managed Content Settings
1 Year Delete                             Personal         Managed Content Settings
5 Year Delete                             Personal         Managed Content Settings
Never Delete                              Personal         Managed Content Settings
Recoverable Items 14 days move to archive RecoverableItems Managed Content Settings

# default retension policy is not applied by default, however
# for users that in-place archive folder is enabled, default retension policy is applied to them automatically
[PS] C:\Users\exchangeadmin> Get-Mailbox "Debian" | Select Name,ArchiveDatabase,RetentionPolicy 

Name   ArchiveDatabase RetentionPolicy
----   --------------- ---------------
Debian

[PS] C:\Users\exchangeadmin> Get-Mailbox "Serverworld" | Select Name,ArchiveDatabase,RetentionPolicy 

Name         ArchiveDatabase      RetentionPolicy
----         ---------------      ---------------
Server World Archive Database 001 Default MRM Policy


# to create new retension policies, configure like follows

# create new retension policy tags
# * for each parameters, refer to [Get-Help New-RetentionPolicyTag -Full]
[PS] C:\Users\exchangeadmin> New-RetentionPolicyTag -Name "2 Year Delete" -Type All -AgeLimitForRetention 730 -RetentionAction DeleteAndAllowRecovery 
[PS] C:\Users\exchangeadmin> New-RetentionPolicyTag -Name "3 Month move to Archive" -Type All -AgeLimitForRetention 90 -RetentionAction MoveToArchive 

# create new retension policies and link to retension policy tags
# * for each parameters, refer to [Get-Help New-RetentionPolicy -Full]
# * to specify multiple tags, use comma separated
[PS] C:\Users\exchangeadmin> New-RetentionPolicy "My Delete Policy" -RetentionPolicyTagLinks "2 Year Delete" 
[PS] C:\Users\exchangeadmin> New-RetentionPolicy "My Archive Policy" -RetentionPolicyTagLinks "3 Month move to Archive" 

[PS] C:\Users\exchangeadmin> Get-RetentionPolicy 

Name                      RetentionPolicyTagLinks             Guid
----                      -----------------------             ----
Default MRM Policy        {Recoverable Items 14 days move to  c4ca90d1-b613-4294-a344-a12df088254
                          archive, Never Delete, 5 Year       5
                          Delete, 1 Year Delete, 6 Month
                          Delete, 1 Month Delete, 1 Week
                          Delete, Personal never move to
                          archive, Personal 5 year move to
                          archive, Default 2 year move to
                          archive, Personal 1 year move to
                          archive}
ArbitrationMailbox        {Never Delete,                      29e4e2b5-4852-4df1-ae09-366f3e053bc
                          AsyncOperationNotification,         4
                          ModeratedRecipients, AutoGroup}
My Delete Policy          {2 Year Delete}                     206df790-1fc5-4e1c-b72f-0cbc6cc3423
                                                              2
My Archive Policy         {3 Month move to Archive}           79b92311-cc36-4d61-8a64-35be9e39657
                                                              9

[PS] C:\Users\exchangeadmin> Get-RetentionPolicyTag | Format-Table -AutoSize -Wrap 

Name                                      Type             Description
----                                      ----             -----------
Personal 1 year move to archive           Personal         Managed Content Settings
Default 2 year move to archive            All              Managed Content Settings
Personal 5 year move to archive           Personal         Managed Content Settings
Personal never move to archive            Personal         Managed Content Settings
1 Week Delete                             Personal         Managed Content Settings
1 Month Delete                            Personal         Managed Content Settings
6 Month Delete                            Personal         Managed Content Settings
1 Year Delete                             Personal         Managed Content Settings
5 Year Delete                             Personal         Managed Content Settings
Never Delete                              Personal         Managed Content Settings
Recoverable Items 14 days move to archive RecoverableItems Managed Content Settings
2 Year Delete                             All              Managed Content Settings
3 Month move to Archive                   All              Managed Content Settings

# set retension policies to users
[PS] C:\Users\exchangeadmin> Set-Mailbox "Debian" -RetentionPolicy "My Delete Policy" 
[PS] C:\Users\exchangeadmin> Start-ManagedFolderAssistant -Identity "Debian" 

[PS] C:\Users\exchangeadmin> Set-Mailbox "Ubuntu" -RetentionPolicy "My Archive Policy" 
[PS] C:\Users\exchangeadmin> Start-ManagedFolderAssistant -Identity "Ubuntu" 

[PS] C:\Users\exchangeadmin> Get-Mailbox -Filter "Name -NotLike 'DiscoverySearchMailbox*'" | Select Name,ArchiveDatabase,RetentionPolicy 

Name           ArchiveDatabase      RetentionPolicy
----           ---------------      ---------------
Server World   Archive Database 001 My Delete Policy
Exchange Admin Archive Database 001 Default MRM Policy
Red Hat
Debian
Fedora Linux   Archive Database 001 My Archive Policy
Rocky Linux                         Default MRM Policy
Exchange Server 2019 : Set Retension Policies (GUI)
[2] Sign in to Exchange Server Admin Center. Next, select [compliance management] on the left pane and move to [retenstion tags] tab on the right pane, then, it's possible to create or edit retension policy tags.
[3] In [compliance management] - [retension policies] tab, it's possible to create or edit retension policies.
[4] To apply retension policy to a user, move to user's settings for mailbox and set like follows.
[5] For example, messages that [Delete And Allow Recovery] policy is applied are moved to [Deleted items] folder automatically after expired, however, it's possible to recover them in [Deleted items] folder by clicking [Recover deleted items] link.
[6] For example, messages that [Move To Archive] policy is applied and also in-place archive folder is enabled are moved to archive folder automatically after expired.
Matched Content