The following are 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
- 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
- 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
- Notes
- Experienced the rare failure when running PSCONFIG. In the error diagnostics log, 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.
Could not find the feature using Get-SPFeature, nor was it found in AllWebParts table. I had the choice of: 1) searching a number of different tables in the content database, 2) writing a complex PowerShell script, or 3) executing a single simple stsadmn -o enumallwebs command. The choice was simple. - 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 enumerate lots of other objects across the entire farm, such as event receivers, web parts, etc.
No comments:
Post a Comment