Delete all personal site collections

Scenario:
To save space, you want to delete all "personal" site collections from your local copy of the production content database.

PowerShell script:

 get-spsite -Limit ALL | where {$_.url -match "/personal/"} | ForEach-Object {Remove-SPSite -Identity $_.ID -Confirm:$false –GradualDelete}  

Note:
You can change the URL pattern to something else by replacing "/personal/" with your pattern.

Leave a Reply