Why can't I restore a OneDrive for Business site through Admin UI?
If a work or school account is deleted from the Microsoft Office 365 admin center, or is removed through Active Directory synchronization, their OneDrive site is marked for deletion. After a 93 day retention period, their site is moved to their recycle bin.
This recycle bin is not visible to Admin users, and it is not possible to restore or recover deleted OneDrive sites through the Admin UI.
Note: OneDrive sites remain in the recycle bin for 93 days before being permanently deleted.
Administrators should use PowerShell to confirm that the OneDrive site is in the recycle bin and is available to be restored.
Note: To perform the steps below you will need to have the SharePoint Management Shell installed.
- Open PowerShell
- Connect to the service:
Connect-SPOService -Url <https://yourdomain-admin.sharepoint.com>
- Sign in with administrator credentials
- Determine if the site is available for restore
- If you know the URL of the delete site, use the following command
Get-SPODeletedSite -Identity <ODBSiteUrl>
- If you do not know the URL of the deleted site, use the following command
Get-SPODeletedSite -IncludeOnlyPersonalSite | FT url
- If the site appears in the results, it is in the recycle bin and available to be restored
- Once the site is located, restore the site to an active state
Restore-SPODeletedSite -Identity <ODBSiteURL>
- Assign an owner to the site to access the desired data
Set-SPOUser -Site <ODBSiteURL> -LoginName <UPNofDesiredAdmin> -IsSiteCollectionAdmin $True
You will now be able to access the restored site with the user that was assigned as site collection administrator and access any desired data.
Action after data recovery
Once you have obtained the desired data from the restored site, you will want to delete the site to prevent an orphaned site from remaining in your tenant.
Note: This deletion is permanent, and the site will not be available to be restored again
Remove-SPOSite -Identity <ODBSiteURL>