Thursday, March 15, 2012

PowerCLI - Connecting to multiple vCenters

By default the connection mode of PowerCLI is set to "Single" which means if you connect to multiple vCenter or server instances, only the last established one is used.

To run a command such as "Get-VM" against all connections, set the connection mode to multiple with the following command:

Set-PowerCLIConfiguration -DefaultVIServerMode Multiple -Confirm:$false
Output:
Proxy Policy    Default Server  Invalid Certificate 
Mode            Action              
------------    --------------- --------------------
UseSystemProxy  Multiple        Unset
To get the current config use Get-PowerCLIConfiguration:
Get-PowerCLIConfiguration
Output:
Proxy Policy    Default Server  Invalid Certificate 
Mode            Action              
------------    --------------- --------------------
UseSystemProxy  Multiple        Unset

Reference: http://www.vmware.com/support/developer/PowerCLI/PowerCLI50/html/Set-PowerCLIConfiguration.html

No comments:

Post a Comment