Sharepoint - How to remove SharePoint Feature from Database

You can remove this feature from the farm, by doing the following:

  • Download SharePoint Feature Administration and Clean Up Tool.
  • Open this tool and reload the web apps > Click on Find Faulty Feature in the farm.

enter image description here

  • Then click yes to remove Faulty Features in your farm

Another solution,

  • Try to run Test-SPContentDatabase as the following:

Test-SPContentDatabase

$wa = Get-SPWebApplication https://sharepoint.contoso.com"
$outputPath = "C:\\tools\files\Output\Test_Wss_Content_MissingAssembly_{0}.txt" -f (Get-Date -Format hhmmss
$dbName = "WSS_Content"
$slqServer = "SPSQL"
Test-SPContentDatabase -Name $dbName -WebApplication $wa -ServerInstance $slqServer -ShowLocation:$true -ExtendedCheck:$false | Out-File $outputPath Write-Host "Test results written to $outputPath"
  • Then open the file in the specified path, get the feature ID and Site ID in the location row and update the below script with theses entries.

  • Then run the below script to remove features by ID:

Script

$featureID = "Feature ID"
$siteID = "Site ID"   

#Display site information
$site = Get-SPSite $siteID  
Write-Host "Checking Site:" $site.Url

#Remove the feature from all subsites
ForEach ($web in $Site.AllWebs)
    {
        If($web.Features[$featureID])
            {
                Write-Host "`nFound Feature $featureID in web:"$Web.Url"`nRemoving feature"
                $web.Features.Remove($featureID, $true)
            }
            else
            {
                Write-Host "`nDid not find feature $featureID in web:" $Web.Url
            }  
    }

#Remove the feature from the site collection
If ($Site.Features[$featureID])
    {
        Write-Host "`nFound feature $featureID in site:"$site.Url"`nRemoving Feature"
        $site.Features.Remove($featureID, $true)
    }
    else
    {
        Write-Host "Did not find feature $featureID in site:" $site.Url
    }
  • Finally, run the below script

     Remove-SPFeatureFromContentDB -ContentDB "Wss_Content" -FeatureId "68642d38-a556-4384-888c-082844fbf224" –ReportOnly
    

If the above steps failed, so you would install the missing feature manually via Install-SPFeature

For more details check

  • Upgrade Cleanup – Missing Server Side Dependencies
  • MISSING SERVER SIDE DEPENDENCIES ISSUE

Tags: