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

This post was originally published on this site

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.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.