Showing posts with label Powershell. Show all posts
Showing posts with label Powershell. Show all posts

Tuesday, 27 September 2011

Bulk Deleting Site Collections

This is not for the faint hearted. The other day I was testing the creation of a few hundred site collections under a managed path; this went well until I came to the point of deleting them and performing another test, the UI is definitely not the way to go.

For your delectation please find below a one line power-shell command to bulk delete number prefixed site collections under a managed path:

Get-SPSite | Where {$_.url -match http://web/sites/[0-9]} | Remove-SPSite -Confirm:$false

Use at your own risk…