VMware Cloud Community
fborges555
Enthusiast
Enthusiast

User connected to the VDI

Hi 

I got the following

$Results= (get-hvmachinesummary -PoolName " Poolname" | where-object{$_.base.basicstate -eq "Connected"}) |select-object  desktopname

I am trying to get the users that is connected to the machine that result holds but is blank.

 

Thanks, guys

 

0 Kudos
5 Replies
Murazik
Contributor
Contributor

Go to IE in Virtual Box and access localhost via http://10.0.2.2  for localhost, or http://10.0.2.2:3000  for localhost:3000.

I kept Network settings as NAT, no need for bridge as suggested above in my case. There is no need to edit any config files.

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

0 Kudos
LucD
Leadership
Leadership

0 Kudos
fborges555
Enthusiast
Enthusiast

L.

yes, I was wondering if I can limit the result to a specific Poolname, using the already piping

 

Thanks

0 Kudos
LucD
Leadership
Leadership

You could try adding a filter on the query.

$poolName = 'MyPool'

$query = New-Object "Vmware.Hv.QueryDefinition"
$query.queryEntityType = 'SessionLocalSummaryView'
$query.Filter = New-Object VMware.Hv.QueryFilterEquals -Property @{'memberName' = 'desktopSummaryData.name'; 'value' = $poolName}
$qSrv = New-Object "Vmware.Hv.QueryServiceService"
$qSRv.QueryService_Query($global:DefaultHVServers[0].ExtensionData,$query) |
Select -ExpandProperty Results |
Select -ExpandProperty NamesData |
Select-Object -Property UserName,DesktopType,DesktopName,MachineOrRDSServerDNS


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

0 Kudos
fborges555
Enthusiast
Enthusiast

L.

 

I get the following error, familiar?

Exception calling "QueryService_Query" with "2" argument(s): "ExceptionType : VMware.Hv.InvalidArgument
ErrorMessage : Invalid member name.
ParameterName : DesktopSummaryData.name"
At line:1 char:1
+ $qSRv.QueryService_Query($global:DefaultHVServers[0].ExtensionData,$q ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : VimException

0 Kudos