Restore files from recycle bin by Powershell Command
“SharePoint Online Management Shell” is require to run the
final code, so please download from here https://www.microsoft.com/en-us/download/details.aspx?id=35588
- Open this link -> https://github.com/sharepoint/pnp-powershell/releases
- Download and install
"SharePointPnPPowerShellOnline.msi"
- After installed .msi
file, Open -> "SharePoint Online
Management Shell"
- Run-> Connect-PnPOnline -Url https://***********.sharepoint.com/sites/TICS
- Enter admin User id and password (like Utpal@*******.onmicrosoft.com
and ********)
- Get user wise documents
detail in bin, replace email id of user and change csv file save path -> Get-PnPRecycleBinItem -firststage | ?
{($_.DeletedByEmail -eq 'Praveen@******.onmicrosoft.com')} | Export-Csv c:\temp\RecycleBinFiles.csv
- Replace email id user
whom documents need to store and run -> Get-PnPRecycleBinItem
-firststage | ? {($_.DeletedByEmail -eq 'Praveen@*******.onmicrosoft.com')} |
Restore-PnpRecycleBinItem -Force
- After finished the
step 7 command, verify the recycle bin documents run step 6 again.
No comments:
Post a Comment