Thursday, February 16, 2012

Restore Deleted Site Collection using power shell

Usually  I do not had a backup of my  my development machine as am not too much worried about information in the site collection. I do not mind creating a new site collection in my dev environmnet, but this time I have built this document management application and had some configuration done which I am due  to present in the conference and accidentally deleted my site collection. Now is a big problem because i only have an hour for the conference where we are showing this product to potential customers. I felt really bad for not having a backup. I was scrambling for help and started to build new site collection and deploying my solution, my friend walked into my office to get ready for the presentation. He saw me configuring the system again and asked me about the situation. I explained him what happened. He is a developer working on the same product and he brought to my notice about our previous presentation for our technical team about PowerShell commands in Sharepoint. we had to update our power shell  presentation then with few new commands that was part of SP1 release.Here is a savior and command is nothing but to restore deleted site collection. 

When you delete the site collection there is now a Site Collection Recycle Bin in Sharepoint 2010 from where you restore it using this command. I have included the Screen shot and the command below. I wanted to pen it down here because I will now remember and would be helpful for some one somewhere in the world.

Commands




Get-SPDeletedSite
Get Deleted Site


Get-SPDeletedSite | where{$_.SiteId -eq “Guid of Site ID″} | Restore-SPDeletedSite


Restore Deleted Site collection


You can find the reference to these Commands Here

No comments:

Post a Comment