Restore A Deleted Site Collection In SharePoint 2010 And 2013 On Premises Using PowerShell Command

There are some cases, where the site collection administrator deletes the wrong site collection or where the users request to delete the wrong site collection and later realize it's still needed. Whatever be the scenario, we don’t have Recycle Bin from where we can restore the deleted site collection and the only way is to use PowerShell command to retrieve it back.

Note

If the site collection is deleted using PowerShell and not from central administration, it will not be possible to retrieve it back,using PowerShell and the only way left would be to restore the previous content database backup of the site collection. 

Dependency

In the case of SharePoint 2010 Server/Foundation, the platform must have the minimum Service Pack1 installed in it.

Now, let’s look at the steps to retrieve the site collection.

Step 1

Please run the command given below to retrieve the deleted site collection.

Get-SPDeletedsite

Ref: https://technet.microsoft.com/en-us/library/hh286316.aspx

The command given above would list down all the site collections which are deleted, and point out the one which we need to restore and copy the ID of it.

Step 2

The command given below would be used to restore the deleted site.

Restore-SPDeletedSite <- Site ID is the one, which we copied in the first step->

Ref: https://technet.microsoft.com/en-us/library/hh286319.aspx

Once it is completely successful, please try to browse the site collection and it should open fine.

Happy learning.