0

I want to get a list of all features in a specific scope using PowerShell. I want to get all activate and inactive features by providing the scope. How can I achieve that?

1 Answer 1

0

You can try the next script

$allSiteFeatures = Get-SPFeature | Where-Object { $_.Scope -eq "Site" }
$activeFeatures = Get-SPFeature -Site "http://sitecollectionUrl"

$allSiteFeatures | ForEach-Object {
$active = $false
    foreach($feature in $activeFeatures)
    {
      if($feature.Id.ToString() -eq $_.Id.ToString())
      {
         $active = $true
      }
    }
    if(!$active)
    {
       $_.DisplayName
    }
}

Greetings

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.