Delete multiple site collections using SharePoint Power Shell Script




This script will delete site collections from the SharePoint server completely. But we need to provide the site collection names to the Power Shell Script as a ";" separated values.

Power Shell Script:

Ex: $SiteCollection = "http://SP-S2010/sites/TeamSite1;http://SP-S2010/sites/TeamSite2" 


$SiteCollection = "http://SP-S2010/sites/TeamSite1;http://SP-S2010/sites/TeamSite2" 
$SiteArray = $SiteCollection.Split(";")

foreach($Site in $SiteArray) 
{  
    Remove-SPSite –Identity $Site –GradualDelete –Confirm:$False
}

Comments

Popular posts from this blog

Power Shell script beginner in SharePoint 2010

Managed Metadata Configuration and Association

Difference Between Site Template and Site Definition