Enterprise Features – Disable features on all site collections

In SharePoint 2013 by rhodzyLeave a Comment

If you need to quickly disable enterprise features on all site except one run the following script

Add-PSSnapin Microsoft.SharePoint.PowerShell -ea SilentlyContinue

$excludeSite = “http://servername/sites/siteToExclude”

$spWebApp = Get-SPWebApplication

foreach($site in $spWebApp.Sites)
{
if ($site.url -ne $excludeSite)
{
$siteUrl = $site.url
Write-Host “Going into SiteCollection $siteurl”
Disable-SPFeature -identity “SharePoint Server Enterprise Site Collection features”
Write-Host “Disabling feature in SiteCollection $siteurl”
}
}