top of page

Data Retention Policies

<#
Exchange Data Retention Policies: 
This is a two step process, where you create a set of rules first “retention Tags” and then apply the rules in your retention policy. 
When creating retention tags there are a few different types of tags you can create:

Default Policy Tag (DPT) – This allows creation of either a deletion policy or archive policy on entire mailbox. 

Retention policy tag (RPT) – Applied to the default folders created when a mailbox is made, examples are Deleted Items, Inbox  
•    Options for this type of tag have to use one of the two deletions types 
o    Delete and Allow Recovery 
o    Permanently Delete 

#>

#Step 1 Create Data Retention Tags
New-RetentionPolicyTag -Name "ScriptsbyScott-Corp-Delete" -Type All -AgeLimitForRetention 365 -RetentionAction DeleteAndAllowRecovery
New-RetentionPolicyTag -Name "ScriptsbyScott-Corp-JunkMail" -Type JunkEmail -AgeLimitForRetention 150 -RetentionAction PermanentlyDelete

 


#Second Step is to create a retention policy and include the tags created above.
New-RetentionPolicy "ScriptsbyScott-RP1" -RetentionPolicyTagLinks "ScriptsbyScott-Corp-Delete","ScriptsbyScott-Corp-JunkMail"

 


#Third Step is to Apply Retention Policy
#Single Mailbox Setting

Set-Mailbox "shead" -RetentionPolicy "ScriptsbyScott-RP1"
#Global Enterprise Setting
Get-Mailbox -ResultSize unlimited | Set-Mailbox -RetentionPolicy "RetentionPolicy-Corp"

 


#Step 4 Verification
Get-Mailbox Shead | Select RetentionPolicy

 

# This tag is assigned to the Retention Policy "ScriptsbyScott-RP1"

# How to update a tag Inside a polciy, will change the 365 day to 800 

Set-RetentionPolicyTag "ScriptsbyScott-Corp-Delete" -AgeLimitForRetention '800'

#Review Updated Tag Setting in Policy

Get-RetentionPolicyTag "ScriptsbyScott-Corp-Delete" | Select AgeLimitForRetention 

bottom of page