How to search in a SharePoint recycle bin?
Helping out with (small) company IT. Everyone using Office365, SharePoint, OneDrive.
The level of tech savvy is not high among users. People often deleting files, which I then need to find/restore. But going to SharePoint online and trying to find things in the recycle bin is misery.
For example, today, I needed to find a copy of an .xls document that I knew the name of, but not the delete date for. SharePoint recycle bin just asks me to scroll through everything deleted, from today on back into history.
There must be a better way.
Top Answer/Comment:
You can use Get-PnpRecycleBinItems and Restore-PnpRecycleBinItems which are part of PnP PowerShell.
Install-Module -Name PnP.PowerShell
Once it's installed, you can connect to your site collection with this:
Connect-PnPOnline -Url https://yourtenant-my.sharepoint.com/personal/jdoe_yourtenant_com -Interactive
(Note, that authentication can be tricky. See the github docs for full details.)
From there, you can enumerate the list of things in the recycle bin:
$items = Get-PnpRecycleBinItems
# select the item(s) you want to restore; you could also use
# Where-Object to filter if you wanted
$itemsToRestore = $items | Out-GridView -OutputMode Multiple
$itemsToRestore | Restore-PnpRecycleBinItems
상단 광고의 [X] 버튼을 누르면 내용이 보입니다