Thursday 22 May 2014

Powershell script to check whetehr the feature is activated or not on a site

$URL = read-host "Enter the Site URL to check the status "
$FeatureName = read-host "Enter the feature name to check the status"


if((Get-SPFeature -Identity $FeatureName -ErrorAction SilentlyContinue -Site  $URL) -ne $null)
{
    Write-Host -Fore Green "Activated"
}
else
{
    Write-Host -Fore Red "Not Activated"
}

No comments:

Post a Comment