Gsanty
Contributor
Contributor

How to pass the windows logged in credential in powershell to connect multiple vCenter

I have multiple vcenter, where i take RDP to Jump server. My requirement is to connect vcenter using powercli with defualt logged in windows credential

I don't want store my credential in .xml or csv or in any format. Just powercli should take automatically my logged in windows credential and connect to vcenter in powercli
$vclist = "vc1","vc2"

Foreach($vc in $vclist){
Connect-VIServer -Server $VC -credential $creds -ErrorAction SilentlyContinue
}

Foreach($vc in $vclist){Connect-VIServer -Server $VC -Force -ErrorAction SilentlyContinue}

Above command works, let say it connect to 1st VC using logged in credential and prompts for credential while connecting to 2nd VC. Please suggest your inputs.

0 Kudos
1 Reply
LucD
Leadership
Leadership

Add the Verbose switch to the Connect-VIServer cmdlet to get more info why it fails on the 2nd VC.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos