VMware Cloud Community
justinsmith
Enthusiast
Enthusiast
Jump to solution

Find what vCenter/s you're connected to?

Is there a command to run in powercli that will tell you what vCenter or vCenters you're connected to?

I've tried Get-VIServer and Get-VC, neither work....

0 Kudos
1 Solution

Accepted Solutions
mattboren
Expert
Expert
Jump to solution

Hello, justinsmith-

You can have a look at the auto-variable, "$global:DefaultVIServers" -- it holds the VIServerImpl objects that correspond to the vCenter- and ESX(i) hosts to which you are currenty connected.

If you are interested in having info about your currently-connected vCenters in the title bar of your PowerShell session (the default behavior in previous PowerCLI releases), there are several places out there that have functions/how-tos for that.  For example, AC wrote about it at vNugglets.com in his Show Currently Connected vCenter Servers in PowerCLI post.

Enjoy

View solution in original post

0 Kudos
3 Replies
mattboren
Expert
Expert
Jump to solution

Hello, justinsmith-

You can have a look at the auto-variable, "$global:DefaultVIServers" -- it holds the VIServerImpl objects that correspond to the vCenter- and ESX(i) hosts to which you are currenty connected.

If you are interested in having info about your currently-connected vCenters in the title bar of your PowerShell session (the default behavior in previous PowerCLI releases), there are several places out there that have functions/how-tos for that.  For example, AC wrote about it at vNugglets.com in his Show Currently Connected vCenter Servers in PowerCLI post.

Enjoy

0 Kudos
Sreejesh_D
Virtuoso
Virtuoso
Jump to solution

run $defaultVIServers.

$defaultVIServers stores the connection information for all connected entities where as the $defaultVIServer will only be the most recent connection.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Isn't that exactly the same thing that Matt said ?


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

0 Kudos