Month February 2019

Restore deleted files from SharePoint Online

The easiest way to restore files in SharePoint Online is obviously just to restore the deleted files using the web interface as Microsoft recommends. However, that won’t work if you need to restore 1000-plus files. Basically, the restore process will just get stuck, and you will probably die of age before anything happens. πŸ’€ PowerShell to the rescue! πŸ¦Έβ€β™‚οΈ Install the SharePoint Patterns and Practices (PnP) cmdlet Connect to the SharePoint site Notice the sites/rooms in the URL. You need to connect to an actual site on your SharePoint, not just the root of the site. In other words, you need to know from which site the files were deleted from. List all deleted items in the site “rooms” List all items deleted by a specific user Restore all files deleted by a specific user The restore process will take a while. In my case, I restored about 1000 files in about 20 minutes. Note that you will not get a restore log, but you can of course use the above command to check if files disappear from the recycle bin. If files exist on the server you will get error messages, which is fine. This just means that the deleted file already exists, or a newer file exists. Sources: Restore Recycle bin SharePoint Online with PowerShell