Monday, 14 January 2019

Restore files from recycle bin by Powershell Command



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

  1. Open this link -> https://github.com/sharepoint/pnp-powershell/releases
  2. Download and install "SharePointPnPPowerShellOnline.msi"
  3. After installed .msi file, Open -> "SharePoint Online Management Shell"
  4. Run-> Connect-PnPOnline -Url https://***********.sharepoint.com/sites/TICS
  5. Enter admin User id and password (like Utpal@*******.onmicrosoft.com and ********)
  6. 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
  7. Replace email id user whom documents need to store and run -> Get-PnPRecycleBinItem -firststage | ? {($_.DeletedByEmail -eq 'Praveen@*******.onmicrosoft.com')} | Restore-PnpRecycleBinItem -Force
  8. After finished the  step 7 command, verify the recycle bin documents run step 6 again.

No comments:

Post a Comment