Restoring a deleted OneDrive using PowerShell

In Office 365, when a user is deleted, his/her OneDrive will be automatically deleted after the given retention period which is by default 30 days. Only a Global Administrator or SharePoint Administrator can restore a deleted OneDrive and assign access to some other user.

All the shared content will be available as they were available before deletion of OneDrive.

Important: One Drive can be restored after 93 days of its deletion. If retention duration is 30 than a deleted OneDrive will be available for 123 days (30 days active, 93 days in recycle bin).

Restoration steps:

First you need to verify that the deleted User’s OneDrive still exist in recycle bin, for that you need to check that using below PowerShell

If you do not the url of deleted OneDrive then run below command which can return list of all deleted OneDrives.

OneDrive all deleted powershell

If you know the url then pass Url to Get -SPODeletedSite cmdlet which can confirm the site availability.

Get deleted OneDrive

If the site is available in recycle bin, then you can follow below URL to restore it. The restoration process is very simple, just pass the OneDrive Url to Resotre-SPODeletedSite cmdlt.

Restore deleted Onedrive

You can also get an error message “Unable to find the deleted site”, there is a possibility that you have added ‘/’ at the end, just remove it and then restore OneDrive.

Restore deleted OneDrive error

Now the OneDrive is restored to an active state.

The following two tabs change content below.
Adnan Amin
Adnan is two time SharePoint MVP (Most Valuable Professional) with over 12 years of extensive experience with major expertise on SharePoint Server, Office 365, .Net Platform and Microsoft BI. He is currently working SharePoint Architect at FMT Consultants. He is MCT Regional Lead for Pakistan Chapter since 2012. He is working on SharePoint for past nine years and worked on different intranet/intranet solutions for private & govt. sector majorly in Gulf region, which include OOB and customized solutions. He is a trainer, technology evangelist and also speaks in community forums.

Leave a Reply