I ran into a problem today, with a script which used to work correctly. It connects to a vCenter server via PowerCLI, and does some stuff. The problem is that I can no longer connect to the server via script, when I specify the credentials. Neither of the following two commands work:
Connect-VIServer -Server $serverName -Credential $cred
or
Connect-VIServer -Server $serverName -User $userName -Password $password
Both return the message "Cannot complete login due to an incorrect user name or password".
So naturally, I double and triple checked that I didn't have a typo when specifying either of them. I've tried this from multiple systems, using different users, so I suspect that the problem is on the server.
Interestingly, if I start PowerShell as a Windows domain user with permissions for the server, and don't specify anything for credentials, it works fine:
Connect-VIServer -Server $serverName
Has anyone ever run into this, and hopefully have a solution as to why this isn't working?