Bulk Restoring of OneDrive files.

I’m not really sure what happened, but I have lost lots of onedrive files. I have been playing around with Windows 11 so i’m blaming that.

I logged into onedrive online and checked the Recycle bin. 85,000 items are sitting in it.
I started to restore the items but it takes webpage allows you only to select 100 at a Minute.

After restoring about 2,000 files i started to look for ways to bulk restore the files.

I found this post. https://lazyadmin.nl/powershell/restore-recycle-bin-sharepoint-online-with-powershell/

There is a fully completed script at https://raw.githubusercontent.com/TheGeorgeDougherty/O365-PS-Scripts/master/SPOnline-Restore-RecycleBin

I saved the script to by temp folder and ran it.

import-module “c:\temp\SPOnline-Restore-RecycleBin.ps1” -force
Restore-RecycleBin -siteUrl https://davidirwin-my.sharepoint.com/personal/dave_davidirwin_uk -newerdate ‘6/30/2021 23:59’ -olderDate ‘6/20/2021 9:00’ -delEmail dave@davidirwin.uk -maxRows 100000

Thanks guys for creating the scripts.

Comments are closed