Forum Discussion

johnjohn-Peter's avatar
johnjohn-Peter
Iron Contributor
Feb 26, 2025

Monitor the documents that got deleted or are near deletion as part of a site retention policy?

If we define this retention policy on one site:-

So what does this policy exactly means? it means that items modified 5 years ago will be permanently deleted even if they are not deleted? or it only affect deleted items?

Second question, is there a way for the admin to monitor the items that are near to be permanently deleted due to a retention policy? or the items that were already permanently deleted?

Thanks

  • Barbarur's avatar
    Barbarur
    Brass Contributor
    1. Yes, files not modified for 5 years will be deleted. You can think of the function as automatic clean up of unneeded files (if your organization thinks files above 5 years are not needed).
    2. you can set an alarm in MS Purview to notify you when a file is deleted by the system. “Monitor files that are about to be deleted” is not a thing. You would need to crawl though all your files regularly to do that, which is a huge workload.
  • RioGrande's avatar
    RioGrande
    Iron Contributor

    1. Enable audit logging:
    Log in to the SharePoint Administrator Center and navigate to Advanced > Audit Log Settings to enable auditing of document deletions and modifications.
    Configure the audit log retention policy to ensure that the logs are kept for a long enough period of time.
    2. Use retention policies:
    Create a retention policy in the Microsoft 365 Compliance Center, selecting the SharePoint site as the target.
    Set the retention period and deletion action, and enable the Notify Before Deletion feature.
    3. View audit logs:
    In the SharePoint Administrator Center, navigate to Audit Log Search.
    Select the time range, user, and activity type (File Deletion) to view the relevant logs.
    Use a PowerShell script:
    Use SharePoint Online Management Shell to query for deleted documents:
    powershell
    Connect-SPOService -Url https://<yourdomain>-admin.sharepoint.com
    Get-SPODeletedSite | Select-Object Title, DeletedBy, DeletedDate
    Queries the documents to be deleted (based on retention policy):
    powershell
    Get-SPOSite -Identity https://<yourdomain>.sharepoint.com/sites/<yoursite> | Get-SPOListItem -List “Documents” | Where-Object { $_. RetentionLabel -eq “Near Deletion” }
    4. Configure the alert:
    In the SharePoint site, navigate to Document Library > Settings > Alerts.
    Create a new alert, select the Delete action, and set the notification method (email).
    5. Contact Microsoft Support:
    If the issue remains unresolved, submit a support request through the Microsoft 365 Administrator Center with detailed error messages and screenshots.

Resources