VMware Horizon Community
rseekell
Enthusiast
Enthusiast
Jump to solution

No User Listed for Connected Desktops in PowerCLI

I would like to know the users that are currently logged on; I would like this list in PowerShell.   It looks like it should be there, but it isn't. 

When I use the View snap-in, I can run Get-DesktopVM | where {$_.user_displayname -ne ""}, but I get no results, even when there are 28 connected sessions.

When I use the HVHelper from Github, Get-HVMachineSummary -State CONNECTED shows all the sessions, but the User column is blank.

When I use VMware.Hv.QueryServiceService and related objects to query, the objects returned (vmware.hv.machinebase) have a blank User (vmware.hv.userOrGroupID).

I've searched the web and this forum but haven't found this issue.

So why are these all blank, and how can I get the usernames of the sessions with PowerShell/PowerCLI?  I'm running Horizon 7.2.

Thanks.

0 Kudos
1 Solution

Accepted Solutions
Magneet
Hot Shot
Hot Shot
Jump to solution

ok, got it if you want to find the logged on user for a certain desktop this is 1 of the methods. No time to make a complete script at the moment but this should get you started Smiley Happy

$hvServer1 = Connect-HVServer -Server CONNECTIONSERVER

$Services1= $hvServer1.ExtensionData

($services1.session.Session_GetLocalSummaryView((get-hvmachine -machinename DESKTOPNAME).base.session)).namesdata

View solution in original post

4 Replies
Magneet
Hot Shot
Hot Shot
Jump to solution

that userorgroupid is for if the desktop is assigned to someone (I have it available on a dedicated desktop. Will come back to you when I have found the way to find the sessions.

0 Kudos
Magneet
Hot Shot
Hot Shot
Jump to solution

ok, got it if you want to find the logged on user for a certain desktop this is 1 of the methods. No time to make a complete script at the moment but this should get you started Smiley Happy

$hvServer1 = Connect-HVServer -Server CONNECTIONSERVER

$Services1= $hvServer1.ExtensionData

($services1.session.Session_GetLocalSummaryView((get-hvmachine -machinename DESKTOPNAME).base.session)).namesdata

rseekell
Enthusiast
Enthusiast
Jump to solution

This is helpful, and I can extend it to list the users on all disconnected or connected desktops.  Thank you.

0 Kudos
Magneet
Hot Shot
Hot Shot
Jump to solution

check the vcheck for horizon view, not sure if I have build that check already but will add it if you like. GitHub - vCheckReport/vCheck-HorizonView: vCheck for Horizon View

0 Kudos