cmjellis
Enthusiast
Enthusiast

What is the Powercli command to find vsphere clients in powercli (is the a parameter that is specific to vsphere client?)

In Powercli I can find  esxi Hosts, I can find virtual machines,  Is there a powercli command to find vsphere client (only vsphere clients). one has to connect to viserver in order to access powercli.

get-host for esxi host

get-vm for virtual machines

get-??? for vsphere client ????

Reply
0 Kudos
LucD
Leadership
Leadership

You mean something like this?

$si = Get-View ServiceInstance -Server $global:DefaultVIServer

$sessMgr = Get-View -Id $si.Content.SessionManager -Server $global:DefaultVIServer

$sessMgr.SessionList |

Select UserName,LoginTime,LastActiveTime,IpAddress,UserAgent


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

Reply
0 Kudos
cmjellis
Enthusiast
Enthusiast

In order for your script to work you have to be logged into the viserver  (i.e $global:defaultViServer(s))

I think i just answered my own question. One has to know the names of  $globaldefaultViServer(s) to connect to vm farm

You don't know what to connect to  - you wont connect

Reply
0 Kudos