I have been using Alan's vcheck report for quite some time with a domain read-only (vcenter) account and it has been working just fine.
I created a new local account on the vcenter and gave that account vcenter read-only rights. If I launch powercli and connect-viserver to the vcenter, it prompts me for a username and password which I enter, it connects on 443 to the vcenter just fine.
However, in vCheck now, when I edit this line, it doesn't work.
$VIConnection = Connect-VIServer $VIServer -user "user123" -Pass "user123" -Protocol Https
When I execute the vcheck.ps1 script, I get:
Cannot complete login due to an incorrect user name or password.
Again, I'm absolutely sure I am using the right account and password. I even changed the script line to use, -user "localhost\user123" and it still fails.
What am I missing to get this script to run under the new local computer account?
Would the password by any chance contain special characters ?
Try placing the password between single quotes
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
No, no special characters. I did some more testing and it turns out the local user needs to be in the Power Users group on the local box (vCenter) in order to execute from a remote computer.
The user was only in the "Users" group - as soon as I changed the groups, it worked right away! thanks for taking the time to look at my post LucD.
Actually, it did not work the way I wanted it too.
If I remove the -user "user123" -Pass "user123" -Protcol Https
from the script and then run it in PowerCLI, I get prompted for the username and password - which I then manually enter and the script executes ok.
When I leave the -user and the -pass in the script, it fails and says bad username/password.
The password has no special characters.
I tried it without double quotes and just single quotes on the password and it still failed.
Any ideas?
Nevermind LucD - nevermind - big stupid stupid mistake on my part and I'm embarrassed....sorry to waste your time!
No problem, glad you found it
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference