SharePoint 2013 TIP: Resources for Finding Feature IDs
The following are some methods for discovering feature IDs:
- Get-SPFeature
- Introduction
- Works great when you need to get a listing of of all installed features.
- Examples
- Get-SPFeature -Limit ALL | Where-Object {$_.Scope -eq "FARM"} | Sort-Object DisplayName | ft -Auto
- Get-SPFeature -Limit ALL | Where-Object {$_.Scope -eq "SITE"} | Sort-Object DisplayName | ft -Auto
- Get-SPFeature -Limit ALL | Where-Object {$_.Scope -eq "WEB"} | Sort-Object DisplayName | ft -Auto
- Get-SPFeature "[GUID]"
- Contra-indications
- If the feature is surfaced in an error message as not installed then Get-SPFeature may not be helpful. For example, say that PSCONFIG fails due to a feature referenced in the database but not installed. Executing Get-SPFeature will return nothing.
- References
- Introduction
- Get-SPSite
- Introduction
- The SPSite.Features property is a collection of all features associated with the site collection.
- Examples
- (Get-SPSite -Identity "[Site collection URL]").Features | Sort-Object DefinitionID | ft -Auto
- Contra-indications
- If you don't know which site collection the missing feature is in, you'll need to loop through them all using this method.
- References
- Introduction
- stsadm -o enumallwebs -includefeatures
- Introduction
- Though long since deprecated, still very useful; and there are some functions that only stsadmn can perform without having to engage some complex PowerShell. Enumerating all features, installed or uninstalled, active or inactive, everywhere is one of those functions.
- Examples
- stsadm -o enumallwebs -includefeatures > C:\EnumAllFeatures.xml
- Contra-indications
- Doesn't return all properties
- References
- Enumallwebs: Stsadm operation (Windows SharePoint Services)
- Stsadm command-line tool (Windows SharePoint Services)
- Complete reference of all STSADM operations (with parameters) in MOSS 2007 SP1
- Index for Stsadm operations and properties (Office SharePoint Server)
- STSADM (Part 1)
- How do I find in which (sub)sites a WebPart/Feature is used?
- The feature with ID : XXX referenced in the database but is not installed on the current farm
- SharePoint Feature Administration and Clean Up Tool
- Introduction
Notes
This posting was originally motivated by my experiencing the rare failure when running PSCONFIG. In the error diagnostics log, I found this message:
[timestamp] PSCONFIG (0x577C) 0x6234 SharePoint Foundation Upgrade SPContentDatabaseSequence ajxkh ERROR Feature (Id = [3caaf2a1-5581-4dd6-9237-66835f99beb4]) is referenced in database [WSS_Content], but isn't installed on the current farm. The missing feature might cause upgrade to fail. If necessary, please install any solution that contains the feature and restart upgrade. 00000000-0000-0000-0000-000000000000.
I first explored various PowerShell methods for retrieving feature IDs. I could not find the feature using Get-SPFeature or in the properties of the Get-SPSite. Nor was it found in AllWebParts table interrogated using a SQL Query (yes, I know I shouldn't have done this, but this was a non-production farm). I eventually found the solution by going back to stsdm and executing a single simple stsadmn -o enumallwebs command. Amazing.
Moreover, you can use the "-includefeatures" option retrieves values in simple, well-formatted XML. Just export to an XML file as shown in the example above and then drop the file onto a browser to instantly see everything in readable XML.
You can also use stsdm to enumerate lots of other objects across the entire farm, such as event receivers, web parts, etc.