Forum Discussion
Mail retention policy for Archive M365 Data Lifecycle Management
- Dec 05, 2023
Hi newtotechcom-J,
no problem 🙂
Exclusion of users from retention policies can be accomplished using the Set-RetentionCompliancePolicy cmdlet.
This cmdlet provides the capability to modify existing retention policies by adding or removing specific locations, such as user mailboxes:Set-RetentionCompliancePolicy -Identity "YourPolicyName" -RemoveExchangeLocation "email address removed for privacy reasons"​<br />The above command is designed to eliminate the mailbox of the email address removed for privacy reasons from the retention policy named YourPolicyName.<br /><br />Set-RetentionCompliancePolicy (ExchangePowerShell) | Microsoft Learn<br /><br />As for when to exclude users, it’s generally more efficient to exclude them before making the custom policy default. This way, you ensure that the policy is correctly configured before it’s applied to all users.<br />
Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.
If the post was useful in other ways, please consider giving it Like.
Kindest regards,
Leon Pavesic
(LinkedIn)
Hi newtotechcom-J,
you're welcome.
Regarding your last question:
To implement a new retention policy as the default for your organization, modify the default mailbox plan via Exchange Online PowerShell with the following steps:
Connect to Exchange Online PowerShell.
Retrieve details about the existing mailbox plans within your organization by executing the following command:
Take note of the currently set default mailbox plan.
Get-MailboxPlan | Format-Table DisplayName, RetentionPolicy, IsDefault
Assign the newly created custom retention policy to the default mailbox plan. Assuming the default mailbox plan is named "ExchangeOnlineEnterprise" and the new custom policy is referred to as "Custom Policy," use the following example:
Set-MailboxPlan "ExchangeOnlineEnterprise" -RetentionPolicy "Custom Policy"
Confirm the modification by verifying the assigned MRM retention policy to the default mailbox plan. Rerun the command from step 2 to review the changes.
You can use this link as a reference:
Customize an archive and deletion policy (MRM) for mailboxes | Microsoft Learn
Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.
If the post was useful in other ways, please consider giving it Like.
Kindest regards,
Leon Pavesic
(LinkedIn)
I'll implement this, I just have one concern, if I applied my new custom policy and I want to exclude some users, is there a way?
And, if I want to exclude them should I do this before making my custom policy as default or after?
Sorry for too many last questions!
- LeonPavesicDec 05, 2023Silver Contributor
Hi newtotechcom-J,
no problem 🙂
Exclusion of users from retention policies can be accomplished using the Set-RetentionCompliancePolicy cmdlet.
This cmdlet provides the capability to modify existing retention policies by adding or removing specific locations, such as user mailboxes:Set-RetentionCompliancePolicy -Identity "YourPolicyName" -RemoveExchangeLocation "email address removed for privacy reasons"​<br />The above command is designed to eliminate the mailbox of the email address removed for privacy reasons from the retention policy named YourPolicyName.<br /><br />Set-RetentionCompliancePolicy (ExchangePowerShell) | Microsoft Learn<br /><br />As for when to exclude users, it’s generally more efficient to exclude them before making the custom policy default. This way, you ensure that the policy is correctly configured before it’s applied to all users.<br />
Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.
If the post was useful in other ways, please consider giving it Like.
Kindest regards,
Leon Pavesic
(LinkedIn)- newtotechcom-JDec 05, 2023Brass ContributorThank you so much for your help, marking this as best response!