0

Recently ran psconfigui against our SharePoint 2016 web and app servers. The psconfigui against the web server completed but with the following errrors:

An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown.  Additional exception information: 

Feature (Name = [Feature1], Id = [4da8260f-92bc-4fc4-95a5-6107b4d65056], Description = [], Install Location = [Feature1]) is referenced in database [WSS_Intranet], 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.  (EventID:ajxkh)

Feature (Name = [Feature2], Id = [e6b3f18d-fe7c-4d28-91d4-b07ad91a6eb2], Description = [], Install Location = [Feature2]) is referenced in database [WSS_Intranet], 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.  (EventID:ajxkh)

I ran Get-SPFeature | ? { $_.Scope -eq $null } on the web server, but it did not return anything. I then ran Get-SPFeature -Limit All and that did return Feature1 but with a different id.

I decided to run Get-SPFeature | ? { $_.Scope -eq $null } on the appserver, and that returned Feature1 also but with yet another id.

How can I find the features mentioned in the error? And if found is there then a special way that they need to be deleted? Thanks.

0

I find this script useful when clearing "missing server side dependencies". you should check that report in central admin to get more information. It runs on all databases but can be changed to run only on the database mentioned in your error.

Specify your web application URL and feature GUID at the top, alter database details at the bottom.

And delete the -ReportOnly flag when you want to run it for real.

#Specify the web application
$webapp = get-spwebapplication http://intranet

#Specify the feature
$feature = "89c5fe80-b7ea-40f1-b1ea-0df8b90a7410"


function Remove-SPFeatureFromContentDB($ContentDb, $FeatureId, [switch]$ReportOnly)
{
    $db = Get-SPDatabase | where { $_.Name -eq $ContentDb }
    [bool]$report = $false
    if ($ReportOnly) { $report = $true }

    $db.Sites | ForEach-Object {

        Remove-SPFeature -obj $_ -objName "site collection" -featId $FeatureId -report $report

        $_ | Get-SPWeb -Limit all | ForEach-Object {

            Remove-SPFeature -obj $_ -objName "site" -featId $FeatureId -report $report
        }
    }
}
 function Remove-SPFeature($obj, $objName, $featId, [bool]$report)
{
    $feature = $obj.Features[$featId]

    if ($feature -ne $null) {
        if ($report) {
            write-host "Feature $found in" $objName ":" $obj.Url -foregroundcolor Blue
        }
        else
        {
            try {
                $obj.Features.Remove($feature.DefinitionId, $true)
                write-host "Feature successfully removed from" $objName ":" $obj.Url -foregroundcolor Green
            }
            catch {
                write-host "There has been an error trying to remove the feature:" $_
            }
        }
    }
    else {
        #write-host "Feature ID specified does not exist in" $objName ":" $obj.Url
    }
}

foreach($db in $webapp.contentdatabases)
{
    Remove-SPFeatureFromContentDB -ContentDB $db.name -FeatureId $feature -ReportOnly
}
  • 1
    Thanks thekryten. I had to modify Feature $found to be Feature $feature found, and the features found that it deleted seemed to work as I ran psconfigui again with no issues. – THedge Jun 26 '18 at 13:48
  • @THedge awesome :) – thekryten Jun 26 '18 at 19:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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