Delete all emails with attachments after 60 days

Philip Lherisson 0 Reputation points
2025-04-02T20:14:23.0766667+00:00

How do I set all emails with attachments in the company to delete after 60 days. I tried to find the attachment options but could not find them. We would also like this to be automated.

Thanks

Microsoft Purview
Microsoft Purview
A Microsoft data governance service that helps manage and govern on-premises, multicloud, and software-as-a-service data. Previously known as Azure Purview.
1,545 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Ganesh Gurram 6,460 Reputation points Microsoft External Staff
    2025-04-02T21:44:43.31+00:00

    @Philip Lherisson

    ​To automate the deletion of emails with attachments after 60 days in your organization using Microsoft Purview, you can utilize Microsoft Exchange Online's Messaging Records Management (MRM) system. This involves creating a retention tag that specifically targets emails with attachments and then applying this tag through a retention policy.​

    Here's how you can set this up:

    Create a Retention Tag for Emails with Attachments:

    Access the Exchange Admin Center (https://admin.exchange.microsoft.com).​

    Navigate to Compliance Management > Retention Tags.

    Click on New Tag and choose Applied automatically to messages with specific content.​

    Configure the tag with the following settings:​

    • Name: e.g., "Delete Emails with Attachments After 60 Days".
    • Retention Action: Delete and Allow Recovery.
    • Retention Period: 60 days.
    • Condition: Specify that the email has attachments.

    Save the retention tag.

    Reference: https://learn.microsoft.com/en-us/exchange/security-and-compliance/messaging-records-management/retention-tags-and-policies

    https://learn.microsoft.com/en-us/answers/questions/2154653/retention-policy-mrm-not-working

    Create a Retention Policy:

    In the Exchange Admin Center, go to Compliance Management > Retention Policies.​

    Click on New Policy.​

    Provide a name for the policy, such as "Attachment Deletion Policy".​

    Add the retention tag you created earlier to this policy.​

    Save the retention policy.

    Reference: ​

    Apply the Retention Policy to Mailboxes:

    Still in the Exchange Admin Center, navigate to Recipients > Mailboxes.​

    Select the mailboxes you want this policy to apply to.​

    In the Bulk Edit pane, find the Retention Policy option.​

    Apply the newly created "Attachment Deletion Policy" to these mailboxes.​

    Important Considerations:

    Propagation Time - It may take up to 7 days for the retention policy to be fully applied to all targeted mailboxes.​

    Testing - Before deploying this policy company-wide, test it on a small set of mailboxes to ensure it functions as expected.​

    User Communication- Inform your users about this policy to prevent unintended data loss.​

    By implementing this retention policy, emails with attachments will be automatically deleted after 60 days, helping manage mailbox sizes and maintain compliance with your organization's data retention policies.

    For more details refer: https://learn.microsoft.com/en-us/exchange/security-and-compliance/messaging-records-management/retention-tags-and-policies

    https://learn.microsoft.com/en-us/answers/questions/2154653/retention-policy-mrm-not-working

    I hope this information helps.

    Kindly consider upvoting the comment if the information provided is helpful. This can assist other community members in resolving similar issues. 


  2. Pauline Mbabu 830 Reputation points Microsoft Employee
    2025-04-03T12:03:04.43+00:00

    Hello @Philip Lherisson ,
    To automate the deletion of emails with attachments after 60 days, you can create a retention policy in Microsoft Purview. This policy can be configured to target only emails with attachments and set to delete them after the specified period. You can also use PowerShell for automation if needed.
    I hope this helps to answer your question.

    If you find the answer above helpful, please Accept the answer to help anyone in the community who might have a similar question to quickly find the solution.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.