VMware Cloud Community
chakoe
Enthusiast
Enthusiast
Jump to solution

connect-viserver to multiple viservers @ the same time fails

Hi,

because we were force to leave the linked mode, we cannot use the connect-viserver -alllinked anymore..

So google told me to use connect-viserver vc1 , vc2

You can check this if you check the value $global:DefaulViServers

In my case, there is only vc2 listed, even if the connect to both vcenters works fine...

Version is PowerCLI 5.1 Release 1

Why?

Thx in advance

Chakoe

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Add the Scope parameter

Set-PowerCLIConfiguration -DefaultVIServerMode Multiple -Scope Session


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

View solution in original post

0 Kudos
7 Replies
LucD
Leadership
Leadership
Jump to solution

You can indeed run Connect-VIServer against multiple vSphere servers.

How did you run the cmdlet ? Like this

Connect-VIServer -Server "vc1","vc2"

And the account under which you run the cmdlet has access to both vCenters I assume ?

Btw, are you sure you displayed

$global:defaultviservers

and not

$global:defaultviserver


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

0 Kudos
chakoe
Enthusiast
Enthusiast
Jump to solution

yes, as cou can see in my PN... this fails

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Indeed I see, but are you running your session in "multiple" mode ?

Do a

Get-PowerCLIConfiguration


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

0 Kudos
aravinds3107
Virtuoso
Virtuoso
Jump to solution

Try setting PowerCLI to multiple mode and then try connecting multiple servers

Set-PowerCLIConfiguration -DefaultVIServerMode multiple -Confirm:$false

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful |Blog: http://aravindsivaraman.com/ | Twitter : ss_aravind
chakoe
Enthusiast
Enthusiast
Jump to solution

PowerCLI D:\> Set-PowerCLIConfiguration -DefaultVIServerMode Multiple

Perform operation?

Performing operation 'Update vSphere PowerCLI configuration.'?

[J] Ja  [A] Ja, alle  [N] Nein  [K] Nein, keine  [H] Anhalten  [?] Hilfe (Standard ist "J"): A

Scope    ProxyPolicy     DefaultVIServerMode InvalidCertificateAction  DisplayDeprecationWarnings WebOperationTimeout

                                                                                                  Seconds

-----    -----------     ------------------- ------------------------  -------------------------- -------------------

Session  NoProxy         Single              Unset                     True                       300

User     NoProxy         Single

AllUsers NoProxy         Multiple

PowerCLI D:\> connect-viserver "vc1" , "vc2"
Name                           Port  User
----                           ----  ----
vc1         443   V998DPV1\J131670
vc2         443   V998DPV1\J131670
PowerCLI D:\> $global:DefaultVIServers
Name                      Port  User
----                           ----  ----
vc2                         443   V998DPV1\J131670
PowerCLI D:\VCenter-Skripte\eNovoH\compare_count_Cluster_Folder_Hosts>
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Add the Scope parameter

Set-PowerCLIConfiguration -DefaultVIServerMode Multiple -Scope Session


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

0 Kudos
chakoe
Enthusiast
Enthusiast
Jump to solution

Thank you! Works now!

0 Kudos