Wednesday, October 2, 2013

A sample PowerCLI script for iterating multiple vCenters

Add-PsSnapin VMware.vimAutomation.core
$vcs=@()
$vcs +="vCenter1"
$vcs +="vCenter2"
$vcs +="vCenter3"
foreach ($vc in $vcs)
{
"Connecting to $vc"
Connect-VIServer -server $vc -user xxx -password xxx
"Connected to $vc"
}
...
Disconnect-VIServer *

1 comment:

  1. 1xbet korean | Legalbet.co.kr
    ⭐ Sportsbet Online in Korea, 1xBet Online in Nigeria, 1xBet Online 1xbet ставки in Kenya, 1xbet Online in Nigeria.

    ReplyDelete

Popular Posts

About Me

My photo
The intent of this blog is to share my work experience and spread some smart solutions on Linux to System Administrators. I'm hoping the solutions shared in this Blog would be helpful and come as a handy for Viewers. Brief about me: I have 18+ years work experience in System and Cloud Administration domain, primarily works on VMware Cloud Products (vSphere, vCloud Director, vRealize Automation, NSX Adv. Load Balancer, vROps).