Hi All,
We have one file uploaded by customer into the document library.
The file icon shows as if the file has been checked out by someone. But actually Checked Out To field is empty.
If I try to check in or discard checkout it is giving above error.
I tried multiple ways to delete/checkin/checkout it but couldn't succeed using below script.
$targetWeb = "https://site"
$targetLibrary = "library/folder"
$fileName = "Current Permissions Summary_20150624.xls"
$myWeb = Get-SPWeb $targetWeb
$myLib = $myWeb.GetFolder($targetLibrary)
$myFile = $myLib.Files | ? {$_.name -eq $fileName}
# for CheckIn use the following line otherwise comment it out with a #
$myFile.CheckIn("MyCheckIn Comment")
# or to undo the CheckOut use the line below
#$targetLibrary.GetFile($myFile).CheckOut()
$myFile.CheckOut()
$myFile.UndoCheckOut()
$myFile.Update()
Including SPFile object properties for reference.
EffectiveRawPermissions : FullMask
EffectiveAuditMask : None
Exists : True
Properties : {vti_categories, vti_nexttolasttimemodified, vti_assignedto, vti_level...}
ForwardLinks : {}
BackwardLinks : {}
Title : Current Permissions Summary_Updated
Length : 119296
TotalLength : 119296
LengthByUser :
Author : i:0#.w|****
ModifiedBy : i:0#.w|*******
TimeCreated : 6/25/2015 3:50:14 AM
TimeLastModified : 5/4/2016 1:45:08 AM
CustomizedPageStatus : None
ETag : "{5959E59D-AE3F-4953-81DD-E93331A75C2D},4"
LockType : None
LockId :
LockedDate :
LockExpires :
LockedByUser :
CheckOutStatus : None
CheckOutType : None
CheckedOutDate :
CheckOutExpires :
CheckedOutBy :
CheckedOutByUser :
CheckInComment :
Generator :
CharSetName :
ProgID :
UIVersion : 512
MajorVersion : 1
MinorVersion : 0
UIVersionLabel : 1.0
ParentFolder :
library/folder
Url :library/folder/Current Permissions Summary_20150624.xls
UniqueId : 5959e59d-ae3f-4953-81dd-e93331a75c2d
ServerRelativeUrl : /site/library/folder/Current Permissions Summary_
20150624.xls
IconUrl : icxls.png
Name : Current Permissions Summary_20150624.xls
RequiresCheckout : True
DocumentLibrary : Lib
Versions : {}
Item : Microsoft.SharePoint.SPListItem
ListItemAllFields : Microsoft.SharePoint.SPListItem
InDocumentLibrary : True
Level : Published
IsConvertedFile : False
SourceLeafName :
SourceUIVersion : -1
GeneratingConverterId : 00000000-0000-0000-0000-000000000000
SourceFile :
Web : NCI Intramural Review Site
ServerRedirected : False
IsIRMed : False
IsSharedAccessRequested : False
EventReceivers : {}
Please let me know if you have any suggestions.
Thanks,
Rahul
ASP.NET, C# 4.0, Sharepoint 2007/2010, Infopath 2007/2010 Developer http://sharepoint247.wordpress.com/










