Finding files in SPO recycle bin

%3CLINGO-SUB%20id%3D%22lingo-sub-160075%22%20slang%3D%22en-US%22%3EFinding%20files%20in%20SPO%20recycle%20bin%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-160075%22%20slang%3D%22en-US%22%3E%3CP%3Ewhat%20is%20the%20trick%20for%20finding%20specific%20files%20in%20SPO%20recycle%20bin%3F%20we%20can%20only%20sort%20by%20title%20and%20date%20deleted%2C%20there%20is%20no%20filtering%20and%20when%20there%20are%20thousands%20of%20files%2C%20it%20is%20an%20endless%20scroll%20which%20is%20unusable.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-160075%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-287616%22%20slang%3D%22en-US%22%3ERe%3A%20Finding%20files%20in%20SPO%20recycle%20bin%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-287616%22%20slang%3D%22en-US%22%3E%3CP%3EI've%20found%20this%20UNTESTED%20and%20(relativelly)%20old%20powershell%20script%20search%20option%2C%20that%20we'll%20explore%20in%20our%20team.%20%3CA%20href%3D%22http%3A%2F%2Fwww.sharepointdiary.com%2F2016%2F07%2Fsharepoint-online-search-recycle-bin-using-powershell.html%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fwww.sharepointdiary.com%2F2016%2F07%2Fsharepoint-online-search-recycle-bin-using-powershell.html%3C%2FA%3E%3C%2FP%3E%3CP%3EAs%20recycleBin%20is%20now%20the%20only%20Back%20Up%20management%20mechanism%20in%20SPO%2C%20it%20is%20almost%20indispensable%20to%20make%20it%20more%20efficient.%20At%20the%20moment%20it%20works%20that's%20it.%20Good%20search%20%2F%20filtering%20mechanism%20would%20make%20it%20great.%3C%2FP%3E%3CP%3EWe%20had%20an%20incident%20where%20a%20user%20misunderstanding%20onedrive%20synchronisation%20just%20deleted%20~7000%20files%20from%20his%20synced%20folders%20(Sharepoint).%20Was%20hell%20to%20find%20all%20these%20mistakenly%20deleted%20files%20(as%20other%20files%20were%20also%20rightfully%20deletes%20in%20the%20middle).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-213533%22%20slang%3D%22en-US%22%3ERe%3A%20Finding%20files%20in%20SPO%20recycle%20bin%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-213533%22%20slang%3D%22en-US%22%3EI'm%20bumping%20up%20this%20old%20thread%20because%20I%20have%20the%20same%20question%20and%20have%20gotten%20no%20where%20in%20my%20research.%20Is%20there%20really%20no%20way%20to%20search%20the%20recycle%20bin%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-576762%22%20slang%3D%22en-US%22%3ERe%3A%20Finding%20files%20in%20SPO%20recycle%20bin%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-576762%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1096%22%20target%3D%22_blank%22%3E%40Dean%20Gross%3C%2FA%3E%26nbsp%3BYou%20can%20use%20PowerShell%20to%20export%20the%20recycle%20bin%20items%20to%20a%20csv%20file%20and%20use%20excel%20to%20filter%20on%20dates%2C%20users%2C%20etc.%3C%2FP%3E%3CP%3EAll%20you%20need%20to%20do%20is%20install%20the%20SharePoint%20PNP%20Powershell%20module%20and%20run%20the%20following%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EConnect-PnPOnline%20-Url%20https%3A%2F%2F%3CSITECOLLECTIONURL%3E%3C%2FSITECOLLECTIONURL%3EGet-PnPRecycleBinItem%20-firstStage%20%7C%20export-csv%20%3CFILEPATH%3E%3C%2FFILEPATH%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-581006%22%20slang%3D%22en-US%22%3ERe%3A%20Finding%20files%20in%20SPO%20recycle%20bin%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-581006%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F158376%22%20target%3D%22_blank%22%3E%40janet%20sleiman%3C%2FA%3Ethanks%20for%20the%20suggestion%2C%20that%20will%20help%20the%20SPO%20admins%2C%20but%20it%20won't%20help%20the%20site%20owners%20who%20can't%20use%20POSH.%20Microsoft%20still%20needs%20to%20address%20this%20basic%20level%20of%20functionality%20in%20the%20UI.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-581109%22%20slang%3D%22en-US%22%3ERe%3A%20Finding%20files%20in%20SPO%20recycle%20bin%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-581109%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1096%22%20target%3D%22_blank%22%3E%40Dean%20Gross%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3CFONT%3E%3CA%20href%3D%22https%3A%2F%2Flazyadmin.nl%2Fpowershell%2Frestore-recycle-bin-sharepoint-online-with-powershell%2Famp%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Flazyadmin.nl%2Fpowershell%2Frestore-recycle-bin-sharepoint-online-with-powershell%2Famp%2F%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eand%20you%20also%20also%20filter%20by%20directory%20name%20%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%24_.DirNAme%20-match%20%22sites%2F%E2%80%A6.%22%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-582494%22%20slang%3D%22en-US%22%3ERe%3A%20Finding%20files%20in%20SPO%20recycle%20bin%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-582494%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F118313%22%20target%3D%22_blank%22%3E%40Eric%20LE%20CORRE%3C%2FA%3E%26nbsp%3B%20thanks%20for%20the%20additional%20suggestion%2C%20but%20this%20won't%20help%20the%20site%20owner%20who%20is%20trying%20to%20find%20a%20file%20that%20was%20deleted.%20Site%20owners%20are%20empowered%20to%20do%20almost%20everything%2C%20they%20should%20not%20have%20to%20open%20a%20support%20ticket%20with%20their%20Help%20Desk%20to%20do%20something%20this%20simple%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-747638%22%20slang%3D%22en-US%22%3ERe%3A%20Finding%20files%20in%20SPO%20recycle%20bin%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-747638%22%20slang%3D%22en-US%22%3E%3CP%3EAgreed%20this%20functionality%20needs%20to%20be%20accessible%20to%20Site%20Collection%20Admins.%20Please%20add%20to%20top%20priority%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-482538%22%20slang%3D%22en-US%22%3ERe%3A%20Finding%20files%20in%20SPO%20recycle%20bin%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-482538%22%20slang%3D%22en-US%22%3E%3CP%3EDid%20someone%20find%20out%20how%20you%20can%20select%20files%20from%20the%20recycle%20bin%20to%20remove%20(filter%20on%20user%2C%20sort%20on%20file%20size%20etc.)%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1096%22%20target%3D%22_blank%22%3E%40Dean%20Gross%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1761630%22%20slang%3D%22en-US%22%3ERe%3A%20Finding%20files%20in%20SPO%20recycle%20bin%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1761630%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1096%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3E%40Dean%20Gross%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3BCan%20we%20run%20a%20similar%20command%20to%20export%20the%20items%20from%20the%20Second%20Stage%20recycle%20bin%20of%20a%20users'%20OneDrive%20recycle%20bin%3F%26nbsp%3B%20Also%20do%20you%20know%20if%20we%20can%20run%20a%20Flow%20that%20checks%20for%20items%20in%20a%20users%20OneDrive%20Second%20Stage%20recycle%20bin%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1770898%22%20slang%3D%22en-US%22%3ERe%3A%20Finding%20files%20in%20SPO%20recycle%20bin%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1770898%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1096%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3E%40Dean%20Gross%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ECan%20we%20run%20a%20similar%20command%20to%20export%20the%20items%20from%20the%20Second%20Stage%20recycle%20bin%20of%20a%20users'%20OneDrive%20recycle%20bin%3F%26nbsp%3B%20Also%20do%20you%20know%20if%20we%20can%20run%20a%20Flow%20that%20checks%20for%20items%20in%20a%20users%20OneDrive%20Second%20Stage%20recycle%20bin%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1772439%22%20slang%3D%22en-US%22%3ERe%3A%20Finding%20files%20in%20SPO%20recycle%20bin%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1772439%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F448686%22%20target%3D%22_blank%22%3E%40csesti-Jabil%3C%2FA%3E%26nbsp%3Byou%20can%20use%20the%20same%20command%20with%20the%20Second%20Stage%20switch%3C%2FP%3E%3CP%3EGet-PnPRecycleBinItem%20-SecondStage%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Respected Contributor

what is the trick for finding specific files in SPO recycle bin? we can only sort by title and date deleted, there is no filtering and when there are thousands of files, it is an endless scroll which is unusable.

10 Replies
Highlighted
I'm bumping up this old thread because I have the same question and have gotten no where in my research. Is there really no way to search the recycle bin?
Highlighted

I've found this UNTESTED and (relativelly) old powershell script search option, that we'll explore in our team. http://www.sharepointdiary.com/2016/07/sharepoint-online-search-recycle-bin-using-powershell.html

As recycleBin is now the only Back Up management mechanism in SPO, it is almost indispensable to make it more efficient. At the moment it works that's it. Good search / filtering mechanism would make it great.

We had an incident where a user misunderstanding onedrive synchronisation just deleted ~7000 files from his synced folders (Sharepoint). Was hell to find all these mistakenly deleted files (as other files were also rightfully deletes in the middle).

 

Highlighted

Did someone find out how you can select files from the recycle bin to remove (filter on user, sort on file size etc.) @Dean Gross 

Highlighted

@Dean Gross You can use PowerShell to export the recycle bin items to a csv file and use excel to filter on dates, users, etc.

All you need to do is install the SharePoint PNP Powershell module and run the following:

 

Connect-PnPOnline -Url https://<sitecollectionurl/
Get-PnPRecycleBinItem -firstStage | export-csv <filepath>

Highlighted

@JSleithanks for the suggestion, that will help the SPO admins, but it won't help the site owners who can't use POSH. Microsoft still needs to address this basic level of functionality in the UI.

Highlighted

@Dean Gross

 

 https://lazyadmin.nl/powershell/restore-recycle-bin-sharepoint-online-with-powershell/amp/

 

and you also also filter by directory name : 

 

$_.DirNAme -match "sites/…."

Highlighted

@Eric LE CORRE  thanks for the additional suggestion, but this won't help the site owner who is trying to find a file that was deleted. Site owners are empowered to do almost everything, they should not have to open a support ticket with their Help Desk to do something this simple

Highlighted

Agreed this functionality needs to be accessible to Site Collection Admins. Please add to top priority

Highlighted

@Dean Gross 

Can we run a similar command to export the items from the Second Stage recycle bin of a users' OneDrive recycle bin?  Also do you know if we can run a Flow that checks for items in a users OneDrive Second Stage recycle bin?

Highlighted

@csesti-Jabil you can use the same command with the Second Stage switch

Get-PnPRecycleBinItem -SecondStage