Permissions/Settings needed for CheckIn-PWDocumentsOrFree

I have files checked out by a Restricted Admin account via a PowerShell script.  When I try to Free them using the same account in a later script, I get an error 58017.  This is apparently:

Error 58017: Document is not checked out to this node. You cannot check in or free documents that are checked out to another node.

This only occurs if this account is in the Restricted Admins group.  When placed in the Administrators group, it works.  But we would like to keep the account as Restricted Admins for internal reasons.  Any idea what could be causing this error?  I have tried a few variations on the below lines, all with the same results.  I can provide additional code but up to this point it reads data from spreadsheets and logs into the datasource.  I then get the file by searching on the file name and path.

$myFile = Get-PWDocumentsBySearch -FolderPath $docPath -DocumentName $importFile.Name -JustThisFolder -GetAttributes -Slow
CheckIn-PWDocumentsOrFree -InputDocument $myFile -Free

$myFile = Get-PWDocumentsBySearch -FolderPath $docPath -DocumentName $importFile.Name -JustThisFolder
CheckIn-PWDocumentsOrFree -InputDocument $myFile -Free

Get-PWDocumentsBySearch -FolderPath $docPath -DocumentName $importFile.Name -JustThisFolder -GetAttributes -Slow | CheckIn-PWDocumentsOrFree -Free

All of these result in the 58017 error as listed above.  Any thoughts?  The user account has the right to Free documents.

Kindest Regards,

Kar S

Parents Reply Children
  • Oh, I see...

    Sorry for the confusion.  Using the latest PowerShell 64 bit version, I successfully logged in with a user only in the Restricted Administrator group, checked out a document with Checkout-PWDocuments and freed it with  CheckIn-PWDocumentsOrFree.   

    Asking the obvious, are you sure you are executing the checkout script and the free script on the same computer?  If you are logged in as user in the Administrator group, you will be able to free documents from any computer.  However if the logged in user is not in the Administrator group (Restricted Administrator is not the same) you need to free from the computer you checked the document out from.  That is, unless you set up security as I mentioned previously.

    Mark Weisman | Bentley Systems