VMware Cloud Community
eccl1213
Enthusiast
Enthusiast

Horizon View Session details for Secure Gateway

I'm trying to figure out a way to return a list of Horizon sessions with the name of the Secure gateway through which the session is connecting.

When viewing Sessions via the Horizon view admin, its seen the "Secure Gateway" field.

The Get-RemoteSessions doesn't seem to return this field?

Specifically, I would like a list that shows me connected session through the Secure Gateway, then pipe that into a log-off command.  That way we can automate a log-off for external users each night, but not affect our internal users.

Reply
0 Kudos
8 Replies
LucD
Leadership
Leadership

Which PowerCLI version are you using?

Do a Get-PowerCLIVersion


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

Reply
0 Kudos
eccl1213
Enthusiast
Enthusiast

I have 6.5 release 1 Build 4624819 loaded right now.

The View servers (7.1) have the version installed by View under the "extras" dir.  It doesn't return a Get-PowerCLiVersion so I'm not sure is bundled with view 7.1

Reply
0 Kudos
LucD
Leadership
Leadership

Strange, the PSSnapin that used to be there with View 5.*, don't work with Horizon View 6.* and 7.*

In fact I don't have these PSSnapin anymore on my Horizon View Connection Servers.

Could these be a relic from a previous View 5.* installation?

In PowerCLI 6.5.1 there is a whole new View module, and a HVHelper module.

Also see Getting Started with PowerCLI for Horizon View


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

Reply
0 Kudos
eccl1213
Enthusiast
Enthusiast

No, its not a hold over from 5.1

Brand new installs of View 7.x place the add-snapin.ps1 to the extra directory on the view server. C:\program files\VMware\VMWare View\server\extra\powershell which calls the \bin\PowershellServiceCmdlets.dll has a file version of 7.1.0.20598

The server I'm testing with right now was installed fresh with 7.1 only a few weeks ago

But, either way, I was using the HVHelper module on my local copy of PowerCli and I wasn't able to return the secure gateway field.

I'll install any version of PowerCli available if need be.

Reply
0 Kudos
LucD
Leadership
Leadership

Yes, the two .ps1 files are still there in the Extras folder, but not the PSSnapin.

That's what I wanted to say.

I'll check if I can retrieve the Secure Gateway somewhere.


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

Reply
0 Kudos
eccl1213
Enthusiast
Enthusiast

Ok. reviving this thread.

I started playing with this again.

Using the following

$query.queryEntityType = 'SessionLocalSummaryView

$Sessions = $query_service.QueryService_Query($ViewAPI,$query)

I can then use this to return the session username and the securegatewayDNS

$Sessions.Results.NamesData

But this does not return the session status (ie connected or disconnected).

This one does show the connected/disconnect but not the username or machine id.

$Sessions.Results.SessionData

How do I combine these so I can see Username,MachineName, SecurityGatewayDNS and the Session status?

What I'm ultimately trying to do is find all sessions in a "connected" state  that do NOT have a securitygatewayDNS and then log them off.

So if the user comes in via the Securitygateway, they are not logged off.  But non-secure gateway session that are connected will get forced off.  Disconnected states can remain.

Reply
0 Kudos
wboaz
Enthusiast
Enthusiast

Did you ever get this figured out?

Reply
0 Kudos
jmolenschot
Contributor
Contributor

Did you figure this out? I'm looking for exactly the same solution.

Reply
0 Kudos