Forum Discussion

ScottBrown's avatar
ScottBrown
Helper II
5 years ago

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

  • edhans's avatar
    edhans
    Community 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:

    1. 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.
    2. 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.
  • Icey's avatar
    Icey
    Community 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.