SharePoint 2016 Troubleshooting: Resolving a missing server side dependency in the Farm Admin content database

Problem

Observed the following issue appearing in the farm health report after removing a commercial farm solution:

[MissingFeature] Database [SharePoint_AdminContent] has reference(s) to a missing feature: Name = [FeatureName], Id = [FeatureID], Description = [], Install Location = [FeatureInstallLocation]. Feature (Name = [FeatureName], Id = [FeatureID], Description = [], Install Location = [FeatureInstallLocation]) is referenced in database [SharePoint_AdminContent], 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.

The explanation in this health rule violation message presents all of the information needed to solve the problem. The following procedure shows you how to resolve this problem solely through the SharePoint PowerShell API and preserving Microsoft support for the Central Administration content database.

Solution

01) First, parse the message and extract key information:

  • Feature ID: FeatureID.

Resolving this missing feature problem involves determining whether it is a site collection feature or web feature because the PowerShell script that needs to be executed will be somewhat different for each case.

02) Search activated Central Administration site collection features

On the farm server hosting the Central Administration web application, in an elevated SharePoint Management Shell, execute the following:

(Get-SPSite -Identity "https://[CentralAdminWebAppURL]").Features | Sort DefinitionID | ft DefinitionID,TimeActivated -auto

Searching through this list, the missing feature ID was not found.

03) Search Activated Central administration web features

In the same shell, execute the following:

(Get-SPWeb -Site (Get-SPSite -Identity "https://[CentralAdminWebAppURL]") -Identity "/").Features | Sort DefinitionID | ft DefinitionID,TimeActivated -auto

Searching through this list, the missing feature ID was in fact found. This indicates that the missing feature is in the Central Administration website's collection of features, or, web feature collection.

04) Build the feature removal script and execute

You'll use the web Features collection's Remove method:

(Get-SPWeb -Site (Get-SPSite -Identity "https://[CentralAdminWebAppURL]") -Identity "/").Features.Remove("FeatureID")

05) Verify removal

Execute the following script in the same shell to see if it appears:

Get-SPWeb -Site (Get-SPSite -Identity "https://[CentralAdminWebAppURL]") -Identity "/").Features | Sort DefinitionID | ft DefinitionID,TimeActivated -auto

If you still see it, not to worry: it may take a minute or two. Eventually, it will be removed.

06) Re-analyze health rule

Navigate back to the missing dependencies health rule, and click on the button to re-analyze,

Summary

This posting engages a solution of a single missing feature instance in the Central Administration content database. If there 40, 50 or even 75 instances, you can still use the same approach.  To do so, you can either: 1) use a PowerShell loop to work through the Features collection, or 2) if you're not comfortable with that, you can use a spreadsheet, build the script to remove one instance using the CONCAT function, and then drag-and-drop to create the 75 removal statements; and then copy and paste. Details on the latter approach can be found in the References below.

References

Note

  • tbd