Hi,
I am facing a peculiar problem and need a help on this.
I have created a powercli script and run it from powercli prompt. In the script I have mentioned the login to VC command as follows:
Connect-Viserver -Server vcservername -User username -Password password.
But it is not logging in to the VC evenif the username and password is correct and thorwing error like incorrect username and password.
However when I am changing the command like below with same username and password I am able to connect to VC server without any issue:
$cred = get-credential
Connect-Viserver -Server vcservername -Crdential $cred
Any idea why it is not getting connected when I am mentioning the username and password in the script.