When you delete a user in the Microsoft 365 admin center (or when a user is removed through Active Directory synchronization), the user's OneDrive will be retained for the number of days you specify in the SharePoint admin center.
To check if the deleted OneDrive can be restored and how to restore, use following PowerShell commands,
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:
Get-SPODeletedSite -Identity <URL>
If you don't know the URL of the deleted OneDrive, run the following command:
Get-SPODeletedSite -IncludeOnlyPersonalSite | FT url
If the OneDrive appears in the results, it can be restored.
Restore the OneDrive to an active state:
Restore-SPODeletedSite -Identity <URL>
Assign an administrator to the OneDrive to access the needed data:
Set-SPOUser -Site <URL> -LoginName <UPNofDesiredAdmin> -IsSiteCollectionAdmin $True
To Permanently Delete a OneDrive:
Remove-SPOSite -Identity <URL>
Remove-SPODeletedSite -Identity <URL>
Note: When you permanently delete a OneDrive, you will not be able to restore it.
Comments
0 comments
Please sign in to leave a comment.