0

How can I find all activated Farm features using PowerShell?

All installed Farm features can be found using:

Get-SPFeature -farm

3 Answers 3

1

this MS developer blog by Joe Rodgers helped us with:

Get-SPWeb http://sharepoint2010/subsite | % {

    $results = @()

    Get-SPFeature -Web $_ -Limit All | % {

        $feature = $_; 
        $featuresDefn = (Get-SPFarm).FeatureDefinitions[$_.ID]; 
        $cc = [System.Globalization.CultureInfo]::CurrentCulture;

        $obj = New-Object PSObject;
        $obj | Add-Member NoteProperty  Title  $($featuresDefn.GetTitle($cc));
        $obj | Add-Member NoteProperty  Hidden $($feature.Hidden);

        $results += $obj;
    }
    $results | FT -Auto;
}
0

As per msdn

The Get-SPFeature cmdlet behaves differently at each scope, returning the enabled Features at each level. If no scope is provided, all installed Features are returned

That means below command will return only active list of features

Get-SPFeature -Farm

Here is another snippet that gives the same result

$siteFeatures = Get-SPFeature | Where-Object {$_.Scope -eq "Farm" }
if ($siteFeatures -ne $null) {
    foreach ($feature in $siteFeatures) {
        if ((Get-SPFeature -Farm | Where-Object {$_.Id -eq $feature.id}) -neq $null) {
       Write-Host "$($feature.Scope) feature $($feature.DisplayName) " -ForeGroundColor DarkRed
       }
   }
}
1
  • At first, scope Farm does not accept url as parameter in Get-Spfeature. Secondly, it only shows installed features, but not activated features.
    – Dre
    Jul 22, 2016 at 11:04
0

You need to get the activated features by the AdministrationService

Powershell :

[Microsoft.SharePoint.Administration.SPWebService]::AdministrationService.Features

C# :

Microsoft.SharePoint.Administration.SPWebService.AdministrationService.Features

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.