Delete all items in Recycle Bin

How to delete all items in a SharePoint Online Recycle Bin using a Power Automate flow. In other words, empty both the first stage and second recycle bin.

URI

Headers

Body

Not applicable

Screenshot with example

deleteallitemsinrecyclebin

Copy/paste example

Resources

RecycleBinItemCollection.DeleteAll method

That’s it, Happy testing!

You may also like...

2 Responses

  1. Bernard Piccoli says:

    I did it exactly this way and it is only cleaning the files that were deleted by the owner of the flow. The flow interprets other people’s files, results in 200, but does not delete them. Can you help me?

  2. David Bump says:

    This is fantastic! It also works with the method MoveAllToSecondStage() in place of DeleteAll(). That is equivalent to the “Empty Recycle Bin” in the GUI. My usage is with a file transit site between groups, where files are frequently deleted, and the recycle bin can become pretty large. In my experience items in the second stage do not count against your site storage quota (SharePoint Online), so emptying the recycle bin automatically on a schedule can be a useful way to keep ahead of quota warnings without losing the ability to restore an item if it was not properly saved to a permanent home before deletion.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.