I am trying to run a Powershell script using Task Scheduler. The script uses a Logical account with an encrypted password file. If run manually, I am prompted to login to the connection client. I can dismiss the client without logging in and the script runs successfully, but if run with task scheduler the script fails with the following error:
Error: [Error 55515: Invalid user name and password combination.]
This is strange since the same password file is used when run manually or through the task scheduler. Here is the code for logging in I use:
If(Test-Path $PWPsswdFilePath){
$SecurePassword = Get-SecureStringFromEncryptedFile -FileName E:\PowerShell\Pswd\Refresh_Geo_PWFiles_pw.txt
} else {
Save-SecureStringToEncryptedFile -FileName E:\PowerShell\Pswd\Refresh_Geo_PWFiles_pw.txt -prompt "enter password to encrypt and store"
}
if (New-PWLogin -DatasourceName $datasource -UserName $pwuser -Password $SecurePassword -NonAdminLogin){
$SecurePassword.Dispose()
Hoping someone may have some experience with this and has found a workaround. I saw a post suggesting rolling back to an older version of ProjectWise on the Server (*.*.*.280). I am considering this however not sure how long the version will be supported and I'd rather know I am using the latest version.
Thanks,
Mike Robertson
Thanks everyone for the feedback. Have tried most of the suggestions to no avail. Somehow, I have now managed to 'break' the connection between ProjectWise and the Connection Client:
Since it seems I need to reinstall ProjectWise, I will roll back to earlier version supporting non-SES licensing.
Is there any reason we would need to have ProjectWise Administrator installed on the Server that is running the scripts?
Mike
You will need to have ProjectWise Explorer or / and ProjectWise Administrator on the machine you are using PWPS_DAB on. If you have both, they must be of the same version.
Mark Weisman | Bentley Systems