Forum Discussion

newtotechcom-J's avatar
newtotechcom-J
Brass Contributor
Nov 27, 2023

Mail retention policy for Archive M365 Data Lifecycle Management

Hi,   I want to apply an email retention policy such that, the emails in the mailbox are retained for 3 years and get deleted and the mail in the archive is there for 5 years and get deleted.   N...
  • LeonPavesic's avatar
    LeonPavesic
    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)

Resources