Is it possible to search the Recycle Bins?
-
16-10-2019 - |
Question
Is it possible to force a search crawler to crawl through the recycle bin(s) on a SharePoint 2010 system?
I'd like to allow my users to delete files/folders in document libraries but if someone accidentally removes a file that they shouldn't it would make everyone's life a lot easier if items in the recycle bin(s) could be included in normal search results.
Solution
Don't know if there is an OOTB solution for this. I couldn't find one. I was able to find something interesting though. you can search Recycle bin using PowerShell
example : (Get-SPSite "http://SERVERNAME:PORT/").RecycleBin | ?{$_.Title -match "DeletedFile"}
Now you can use c# and PowerShell together and write a custom search solution.
OTHER TIPS
As Shoban stated. Powershell is your best bet.
(Get-SPSite "https://SITECOLLECTION/").RecycleBin | ?{$_.Web -match "Sub Site"}
or
(Get-SPSite "https://SITECOLLECTION/").RecycleBin | ?{($_.DeletedDate -gt "5/13/2019") -and ($_.DeletedDate -lt "5/15/2019")}
You should be able to filter by any of the following.
Web
ID
ItemState
ItemType
Title
DirName
LeafName
Author
AuthorId
AuthorName
AuthorEmail
DeletedBy
DeletedById
DeletedByName
DeletedByEmail
DeletedDate
Size
ProgId
ImageUrl