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