Restore a deleted OneDrive when the deleted user no longer appears in the Microsoft 365 admin center
Download the latest SharePoint Online Management Shell.
Note
If you installed a previous version of the SharePoint Online Management Shell, go to Add or remove programs and uninstall "SharePoint Online Management Shell."
Connect to SharePoint as a global admin or SharePoint admin in Microsoft 365. To learn how, see Getting started with SharePoint Online Management Shell.
Determine if the OneDrive is available for restore.
If you know the URL of the OneDrive, run the following command:
PowerShellGet-SPODeletedSite -Identity <URL>
A user's OneDrive URL is based on their username. For example,
https://contoso-my.sharepoint.com/personal/user1_contoso_com
. You can find their username on the Active users (or Deleted users) page in the Microsoft 365 admin center.If you don't know the URL of the deleted OneDrive, run the following command:
PowerShellGet-SPODeletedSite -IncludeOnlyPersonalSite | FT url
If the OneDrive appears in the results, it can be restored.
Restore the OneDrive to an active state:
PowerShellRestore-SPODeletedSite -Identity <URL>
Assign an administrator to the OneDrive to access the needed data:
PowerShellSet-SPOUser -Site <URL> -LoginName <UPNofDesiredAdmin> -IsSiteCollectionAdmin $True
For more info about these cmdlets, see Get-SPODeletedSite and Restore-SPODeletedSite.
Note
When a OneDrive is restored, it will continue to remain available until it's explicitly deleted.
Permanently delete a OneDrive
After you recover the data you need from the OneDrive, we recommend that you permanently delete the OneDrive by running the following command:
Remove-SPOSite -Identity <URL>
Remove-SPODeletedSite -Identity <URL>
Caution
When you permanently delete a OneDrive, you will not be able to restore it.
Source: https://learn.microsoft.com/en-us/sharepoint/restore-deleted-onedrive
Comments
Post a Comment