SharePoint (2003 thru Online): Restoring a deleted OneDrive for Business site

Wednesday, May 16, 2018

Restoring a deleted OneDrive for Business site

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 and is available for 30 days to retain files in OneDrive after the user account is marked for deletion (as per the default setting in OneDrive admin center).

https://admin.onedrive.com/?v=StorageSettings

After a 30 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.

Below are messages you see while manually deleting user from O365 Active Users.



  
Note: OneDrive sites remain in the recycle bin for 93 days before being permanently deleted.
_______________________________________________________________

Recovery process

SharePoint 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 Online Management Shell installed. If you have issues with SharePoint Online Management Shell, try to install SharePoint Online Client Components SDK

(Windows 10 is recommended OS for using SharePoint Online Management Shell. You might see more issues with Windows 7.)
 
1. Open PowerShell as Administrator
2. Connect to the service: Connect-SPOService -Url <https://yourdomain-admin.sharepoint.com>
3. Sign in with SharePoint administrator credentials




4. Determine if the site is available for restore
      If you do not know the URL of the deleted site, use the following command
      Get-SPODeletedSite -IncludeOnlyPersonalSite | FT url

      If you know the URL of the delete site, use the following command
      Get-SPODeletedSite -Identity <ODBSiteUrl>

If the site appears in the results, it is in the recycle bin and available to be restored.
Otherwise the Site is permanently deleted and you cannot restore it.

      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>


Once you all the activities are performed, don't forget to disconnect from the SPOService using the below PowerShell command.

Disconnect-SPOService

1 comment:

  1. Use this Sharepoint Data Recovery software which is an efficient third party software, allows its user to recover data from MS SharePoint Server 2013, 2010 and 2007. The software is empowered with dual recovery modes- Raw file and Live SQL Instance, to make the process simple and effective. It provide enhanced and reliable easy to use user friendly interface to make this software fast and simple.

    ReplyDelete