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 -SlowCheckIn-PWDocumentsOrFree -InputDocument $myFile -Free
$myFile = Get-PWDocumentsBySearch -FolderPath $docPath -DocumentName $importFile.Name -JustThisFolder -GetAttributes -Slow
CheckIn-PWDocumentsOrFree -InputDocument $myFile -Free
$myFile = Get-PWDocumentsBySearch -FolderPath $docPath -DocumentName $importFile.Name -JustThisFolderCheckIn-PWDocumentsOrFree -InputDocument $myFile -Free
$myFile = Get-PWDocumentsBySearch -FolderPath $docPath -DocumentName $importFile.Name -JustThisFolder
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
If you are simply freeing the documents later in the script, why not just copy them to a local folder and then delete the folder when complete? Just a thought.
It is 2 separate scripts. I am exporting files to have them checked out and also saving data on them to spreadsheets, changes are then made by others, and a week or so later they are going back into ProjectWise. Bringing them back in I Free the file, Version the record, then replace the file with the modified version and make sure the workflow state is in the same state the file was in when originally exported.