Quantcast
Channel: SharePoint 2010 - General Discussions and Questions forum
Viewing all articles
Browse latest Browse all 17574

Remove locked/corrupted files from SharePoint

$
0
0

I have a SharePoint library where 2 word documents are locked or corrupted.

The documents are not locked by a user, I get an Access denied message, although I am site collection administrator.

I can view the properties of the document, but cannot save it. (error: Access Denied)
If I click on the link to open the word document, I get: "Could not open "location/filename.docx".

When I select the file and click on 'delete document' I receive again the "Access denied. You do not have permission to perform this action or access this resource".

When I click on 'Manage permissions' (for the document), I get an 'Cannot complete this action. Please try again. Correlation ID ..." error message.

In ULS viewer I can find:

System.Runtime.InteropServices.COMException: Cannot complete this action. Please try again.

at Microsoft.SharePoint.Library.SPRequestInternalClass.GetSecurityInfo(String bstrUrl, String bstrObjUrl, Guid& pguidScopeId, UInt64& pEffectivePermMask, Boolean& pbHasUniquePerm, String& pbstrPermUrl)

at Microsoft.SharePoint.Library.SPRequest.GetSecurityInfo(String bstrUrl, String bstrObjUrl, Guid& pguidScopeId, UInt64& pEffectivePermMask, Boolean& pbHasUniquePerm, String& pbstrPermUrl)

When I open the library in Sharepoin Designer, I don't see these 2 document.

I was able to recover the documents by restoring their backup. This creates a 'new document' (in the database) with the same file name (but different ID). The old 'corrupted' items are still present in the library.

This is what I want to do: I want to delete the 'corrucpted' documents from the library, they have to be removed.

I have already tried this powershell script:

[void][System.reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

# Delete an item from the announcements list by Item ID

$site    =     new-object Microsoft.SharePoint.SPSite(http://sharepoint.net)                                                       
$web     =    $site.OpenWeb("/sitename")                                                                                               

$list    =    $web.Lists["Libraryname"]                                                                             

$deaditem=    $list.GetItemById(219)
[Microsoft.SharePoint.SPSecurity]::RunWithElevatedPrivileges({$deaditem.Delete()})

$web.Dispose()

But again I got the access denied message.

I am out of solutions here ... I am already thinking about deleting the record in the database (table 'Alldocs')- I know it is not recommended. Has anyone experience with this or does anyone see another solution?

Thanks a lot in advance !



Viewing all articles
Browse latest Browse all 17574

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>