SharePoint 2010 SP1 – Site Recycle Bin

 

One of the cool new features introduced in SharePoint 2010 SP1 is the Site Recycle Bin feature.

Earlier, the only way to restore deleted sites and site collections required to restore the appropriate content databases. But from SP1 onwards, deleted sites can be recovered from the Site Recycle Bin.

Deleting and Restoring Sites (SPWeb)

When users delete a site, they are presented with the following page:

clip_image001[4]

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:

clip_image002

Even though it says the site will be deleted permanently, it is not.

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:

clip_image004

Deleting Site Collections (SPSite)

Unfortunately, if a site collection is deleted, the only way to recover is to use the new Restore-SPDeletedSite cmdlet.

When users delete a site collection, they are presented with the following page:

clip_image005

Below are the steps to restore a deleted site collection using PowerShell:

The deleted site collections are stored in the SPDeletedSite object.

The Get-SPDeletedSite cmdlet lists all the deleted site collections:

clip_image006

Do remember that the Get-SPDeletedSite returns an array if Get-SPDeletedSite is > 1. Use the following command to get the count:

(Get-SPDeletedSite).Count

All we need to do now is bind this with the Restore-SPDeletedSite cmdlet:

Get-SPDeletedSite | where{$_.SiteId -eq “d48e6455-a1ad-43f4-ac11-a5b558b06ead”} | Restore-SPDeletedSite

clip_image007

Use the Remove-SPDeletedSite to permanently remove the deleted site collection. As always, use this with caution.

Recommended Reading

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s