Activating and Deactivating Features with PowerShell


SharePoint Group

  • If you install a feature with powershell, you can run the following Windows PowerShell command:
Install-SPFeature FeatureFolderName
  • To activate a feature:
Enable-SPFeature FeatureFolderName -Url http://server/site/subsite
  • To deactivate a feature:
Disable-SPFeature FeatureFolderName -Url http://server/site/subsite
  • To uninstall a feature:
Uninstall-SPFeature FeatureFolderName
  • Examples:

Activate site collection feature

$site = Get-SPSite http://sp2010
Enable-SPFeature -Identity “FeatureName” -Url $site.Url
$site.Dispose()

Activate site feature

$web = Get-SPWeb http://sp2010
Enable-SPFeature -Identity “FeatureName” -Url $web.Url
$web.Dispose()

Activate site collection features for all site collections in a Web Application

$webApp = Get-SPWebApplication -Identity http://sp2010
$webApp | Get-SPSite -limit all | ForEach-Object {Enable-SPFeature -Identity “FeatureName” -Url $_.Url}

Ver la entrada original

Anuncios

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s