Code Play and Learn

Delete Site Collection Using PowerShell

Advertisements

Hi,

Here is Power Shell Code for Delete Site Collection from Particular webApplication

$tmpRoot = Get-SPWebApplication -Identity http://SP:2000
$tmpRootColl=$tmpRoot.Sites
#Enumerate through each site collection
for ($index=$tmpRootColl.Count-1 ; $index-ge 0 ; $index–-)
{
  Remove-SPSite -Identity $tmpRootColl.Item($index) -GradualDelete -Confirm:$false
}
Get-SPDeletedSite | Remove-SPDeletedSite

Thanks
SPS

Advertisements