Restore Deleted Site Collection

One of my colleagues came to me in a flustered state recently, having accidentally deleted one of our main site collections. Alas this was very easily done - when trying to delete a sub site they'd gone into site settings, but from force of habit then clicked into Site Collection Settings, before choosing to delete the site.

This initially gave me pause, because without a Site Collection there's no Recycle Bin to get it back from! Luckily it was straightforward to recover, though Powershell was needed. (Which would be a problem with some hosting companies!)

So I opened the SharePoint Powershell console on the server and typed;

Get-SPDeletedSite "/sites/*"

I used the wildcard because frankly I couldn't remember the exact spelling! ;)

The console returned and confirmed the Site Collection had been deleted and when, plus the correct name.

To recover I typed;

Get-SPDeletedSite "/sites/MySiteCollectionName" | Restore-SPDeletedSite 

Also entered Y to confirm going ahead in the dialogue. The restore took under a second.

 

 

Business happy and a colleague who owes me a drink. Nice afternoons work!

Happy SharePointing!!

Disclaimer: The software, source code and guidance on this website is provided "AS IS"
with no warranties of any kind. The entire risk arising out of the use or
performance of the software and source code is with you.

Any views expressed in this blog are those of the individual and may not necessarily reflect the views of any organization the individual may be affiliated with.