Share via


SharePoint Online Troubleshooting: Restoring deleted site collection

Introduction

This articl is about a SharePoint Online Groups or Communication site owner who reports a missing site.

This tutorial walks you through the process of engaging such a problem in an orderly and documented fashion. It also consolidates all of my notes and references for implementing this routine procedure.

Procedure

1. Verify URL

Launch a browser and connect to the user's site URL to verify it is deleted.

2. SP online management shell & connect tenant

Launch SharePoint Online Management Shell.

Connect to the tenant:

Connect-SPOService -Url "[tenantname]-admin.SharePoint.com" -Credential "[yourSPOAdminAcctEmail]"

3. Retrieve list of deleted site collections

Retrieve and document a list of all deleted site collections to see if its still available for recovery:

Get-SPODeletedSite | Export-CSV -Path "C:\temp\datetime]_SPODeletedSites.csv"

4. Restore

If it's in Recycling, restore it:

Restore-SPODeletedSite -Identity "https://[tenantname].SharePoint.com/sites/[UserSiteName]"

5. Add account as admin

Now add your account to the site's site collection administrator group so that you can connect to it and verify:

SetSPOUser -Site "https://[tenantname].SharePoint.com/sites/[UserSiteName]" -LoginName "[yourSPOAdminAcctEmail]" -IsSiteCollectionAdmin $True

6. Verify restoration

Launch a browser and connect to the user's site URL to verify it is restored

References

Notes

Get-SPODeletedSite returns a key bit of information you may find useful. It has a DaysRemaining column which informs you how many days the site collection has remaining in Recycling. The columns that this report contains are:

  • SiteID
  • URL
  • Status
  • DeletionTime
  • DaysRemaining
  • StorageQuota
  • ResourceQuota