Monday 9 June 2014

Restoring a Site Collection with PowerShell in SharePoint 2013

Once a site collection has been deleted, it goes directly to sharepoint Recycle bin.
Now, if the site collection was deleted through PowerShell or some other code, it cannot be restored using below explained PowerShell command, but if it was deleted through the browser, then it can be restored from recycle bin using below PowerShell command.
Get-SPDeletedSite | Where-Object –Property URL –eq –VALUE “http://SP2013/”) | Restore-SPDeletedSite

In SharePoint 2013; recycle bin, default is set to 30days. So after 30days you cannot get back data from recycle bin. You may change this setting if required.