I am getting error 58289 whenever I try to log in to a logical account using the following syntax:$cred = Get-CredentialNew-PWLogin -DatasourceName <my data source> -UserName TheUser -Password $cred.PasswordAt first, I thought that I was doing the encryption/decription incorrectly, so I demonstrated the problem using the secure string directly (as above). This code works fine on my development machine, but it gives me error 58289 when I run it from the server. I get the same results using Save-SecureStringToEncryptedFile and Get-SecureStringFromEncryptedFile . This was working at some point and I'm not sure when it stopped working. Any ideas?
SecureStrings created without a key only work on the machine and Windows account they were originally created on. If you created the encrypted file on one machine and copied it to another it would not work.
My reading on Get-Crediential is that it uses a different method of encryption and cmdlets have to support the credential object, I'm not sure new-pwlogin does.
Ah, now that I'm back at my computer I tested Get-Credential with New-PWLogin and it does work for me with a logical account.
$cred = Get-Credential
# enter logical account username/password
New-PWLogin -DatasourceName "ds_name" -UserName $cred.UserName -Password $cred.Password
So that part of your test should've worked. Get-PWError 58289 doesn't return an error message so I'm not sure what's going on. I would try making a new encrypted file on the production server instead of copying it from the dev server.
hmm, if I enter an incorrect password into Get-Credential I get an error 58064 not 58289 so I'm not sure this is a password issue.