Saturday, February 22, 2014

Recover a Deleted Site Collection in SharePoint 2010 SP1 and above


Unfortunately, there is no user interface for restoring deleted site collections. Managing deleted site collections requires using PowerShell. SharePoint 2010 introduces 3 new PowerShell CmdLets for managing the Recycle Bin for site collections.
When users delete a site, they are presented with the following page:
image
As you can see from the message, the entire site including its contents, permissions are sent to recycle bin.
When you click Delete, you are prompted with another message box, which may be confusing:
image
Even though it says the site will be deleted permanently, it is not.
Hit OK.
If you are a PowerShell user, you can use the Remove-SPWeb cmdlet to delete the web instead of the UI. Just use the –Recycle parameter:
Remove-SPWeb http://site -Recycle
After the site is deleted, it will be available in the top-level site’s recycle bin to restore:
image
 
The easiest way to get a list of all the deleted site collections is to just call Get-SPDeleteSite without any parameters. In the following example, for brevity, I have formatted the output as a table and filtered the columns displayed. In the second sample, I have added a wildcard filter to the command that can be used to easily filter sites based on relative paths.

 
Once you have identified the site you want to restore, you call the Restore-SPDeletedSite. To restore one or more sites, it is easiest to just pipe the results from Get-SPDeletedSite. By default, the command will ask you to confirm the restore. To eliminate the confirmation, just add "Confirm:$true" to the end of the command.
 
 
 

No comments:

Post a Comment