VMware Horizon Community
SalsaStew
Contributor
Contributor

Get-HVMachineSummary not showing User info

Hi all, I have a Horizon 7.12 environment that I've been querying using the VMware PowerCLI, together with the VMware.Hv.Helper module. When I run the cmdlet Get-HVMachineSummary I don't get any user information being displayed. Does anyone know why this would be the case? I get 'Machine', 'DesktopPool', 'DNS Name', 'Host', 'Agent', 'Datastore', and 'Status' but no 'User' information.

Also, how can I get the 'Display Protocol' displayed, like it does in the Horizon Admin console?

Thanks in advance.

Reply
0 Kudos
1 Reply
RoderikdeBlock
Enthusiast
Enthusiast

I guess the solution presented in this post will show the information you  are looking for:

PowerCLI - List All View Connected Users and VM HostNames

$query = New-Object "Vmware.Hv.QueryDefinition"

$query.queryEntityType = 'SessionLocalSummaryView'

$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

Roderik de Block


Blog: https://roderikdeblock.com
Reply
0 Kudos