Forum Discussion
Use SharePoint Recycle Bin as a Data Source
In lieu of the Teams File Deletion problem on or around 03/15/21 after the Teams outage issue, we had a lot of files get deleted by a rogue process with the outage. We were able to recover them via the Recycle Bin.
I want to create a watch dog report of the file deletions and by whom so we can review and triage if necessary.
- I have tried a SP folder & List connection and it is not there.
- I have tried an OData connection and cannot see it there.
Any suggestions are welcome!
3 Replies
- edhansCommunity Champion
I don't think you can do this directly in Power Query. Even using SharePoint.Contents() I cannot find the recycle bin. I see at least two options:
- Every week I export the Audit Logs for the tenant to a CSV file. It has file deletion data by person. I have a report that shows all deletions across all SharePoint sites in the tenant. Then someone can view that and see if anything looks odd or suspicious.
- You can use PowerShell to export recycle bin contents for a specific site - Get-PnPRecycleBinItem (PnP.Powershell) | Microsoft Docs - that output could be dropped into a folder and a report run over that.
- edhansCommunity Champion
Additionally ScottBrown you can set up alerts in Office 365 for unusual levels of file deletions. See this page for configuration and licensing requirements. Alert policies in the security and compliance centers - Microsoft 365 Compliance | Microsoft Docs
- IceyCommunity Support
Hi ScottBrown ,
How about creating a flow to monitor if anything has been deleted?
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.