1

I looked up a webpart and the only reference was to the web part gallery of the site. I removed the webpart from the list and recycle bin, but when I do a health check the error still persists.

The database still has the entry for the deleted webpart. Should I delete the entry in the database?

Update: I've found the file by GUID. The results I receive are:

EffectiveRawPermissions : 
EffectiveAuditMask      : 
Exists                  : False

 .....

ParentFolder            : 
Url                     : 
UniqueId                : 40a56c20-3e6f-4f8b-9f4a-ab17abf04577
ServerRelativeUrl       : 

 ..... 

IsConvertedFile         : False
SourceLeafName          : 
SourceUIVersion         : 
GeneratingConverterId   : 00000000-0000-0000-0000-000000000000
SourceFile              : 

ServerRedirected        : 
IsIRMed                 : False
IsSharedAccessRequested : False
EventReceivers          : 

Since 'Exists : False' should I just delete the db entry?

1

This is most annoying message i witnessed in SharePoint, when you remove a solution from a farm but for some odd reason it still stay in some places.

their are couple of tools available to remove all the reference of the webpart.

MissingSetupFiles Script(Read instruction from Above Blog)

    param($filename, $delete = $false)
function Run-SQLQuery ($SqlServer, $SqlDatabase, $SqlQuery)
{
    $SqlConnection = New-Object System.Data.SqlClient.SqlConnection
    $SqlConnection.ConnectionString = "Server =" + $SqlServer + "; Database =" + $SqlDatabase + "; Integrated Security = True"
    $SqlCmd = New-Object System.Data.SqlClient.SqlCommand
    $SqlCmd.CommandText = $SqlQuery
    $SqlCmd.Connection = $SqlConnection
    $SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
    $SqlAdapter.SelectCommand = $SqlCmd
    $DataSet = New-Object System.Data.DataSet
    $SqlAdapter.Fill($DataSet)
    $SqlConnection.Close()
    $DataSet.Tables[0]
}
$dbs = get-spcontentdatabase
$dbs | %{
 $db = $_
 $db.Name
 $files = Run-SQLQuery -SqlServer $db.Server -SqlDatabase $db.Name -SqlQuery "SELECT * from AllDocs where SetupPath LIKE '%' +'$filename'" | select Id, SiteId, DirName, LeafName, WebId, ListId
 $files | ?{$_.SiteId -ne $null} | %{
 $file = $_
 $site = get-spsite $file.SiteId
 $web = $site.AllWebs | ?{$_.Id -eq $file.WebId}
 $spfile = $web.GetFile([Guid]$file.Id)
 $web.Site.WebApplication.Url + $spfile.ServerRelativeUrl
 if ($delete -eq $true){
  $spfile.Delete()
 }
 }
}

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.