VMware Horizon Community
HainesFGL
Enthusiast
Enthusiast
Jump to solution

HTML Access Report

I need  to find which users are connecting using HTML access (using web browser).  I believe it's always "Blast" using SSL/443 tunnel.  I'm pretty sure it's logged on security server or connection server.  Looking for the easiest way to extract it and create a report.  For example, from 6/1/20 - 6/30/20 These 458 users connected to vdi using HTML access.

1 Solution

Accepted Solutions
RoderikdeBlock
Enthusiast
Enthusiast
Jump to solution

You could give it a try using PowerCLI:

Connect-HVServer -Server <Your HV Server>

$ViewAPI = $global:DefaultHVServers[0].ExtensionData

$query_service = New-Object "Vmware.Hv.QueryServiceService"

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

$query.queryEntityType = 'SessionLocalSummaryView'

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

$Sessions.Results.Namesdata

This will give you the following output.

Roderik de Block


Blog: https://roderikdeblock.com

View solution in original post

10 Replies
RoderikdeBlock
Enthusiast
Enthusiast
Jump to solution

You could give it a try using PowerCLI:

Connect-HVServer -Server <Your HV Server>

$ViewAPI = $global:DefaultHVServers[0].ExtensionData

$query_service = New-Object "Vmware.Hv.QueryServiceService"

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

$query.queryEntityType = 'SessionLocalSummaryView'

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

$Sessions.Results.Namesdata

This will give you the following output.

Roderik de Block


Blog: https://roderikdeblock.com
HainesFGL
Enthusiast
Enthusiast
Jump to solution

Hi Roderik, This is great stuff and working very well I'm including output from the PowerCli below.  My question is where exactly is this coming from?  Right now I'm pointing to our security server and I'm getting good data output <below>.  Is there a way to include the date and time the session started?

Connect-HVServer : There was no endpoint listening at https://securityserver.domain.com/view-vlsi/sdk that could accept the message. This is often caused by an

incorrect address or SOAP action. See InnerException, if present, for more details.

At C:\Documents\Scripts\HorizonClientConnectionType.ps1:1 char:1

+ Connect-HVServer -Server securitysecury.domain.com

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Connect-HVServer], Exception

    + FullyQualifiedErrorId : System.Exception,VMware.VimAutomation.HorizonView.Commands.Cmdlets.ConnectHVServer

One line of sample output using Export-CSV

"domain.com\\TUser","C1-COMPUTER-254","c1-computer-254.domain.com","7.8.0","c1_pool_o64","Windows 10","AUTOMATED","VIEW_COMPOSER",,"d17c390e-f2d3-6530-ca91-3a57a264bbae","htmlaccess","10.10.10.32","10-10-10-32-Edge","5.0.0","view.domain.com","10.10.10.230","External"

Thank you for your help and suggestion on this.  Very helpful.

Reply
0 Kudos
Mickeybyte2
Hot Shot
Hot Shot
Jump to solution

Hi,

The connect-HVServer should connect to a Horizon Connection server. I don't think a security server will work.

Regards,

Michiel

Regards, Michiel.
Reply
0 Kudos
HainesFGL
Enthusiast
Enthusiast
Jump to solution

What is the source of the data output?  I can't tell from the PowerCli...  How can I include the session date & time?

Odd thing is that I coonected to security server and got the error above, then several hundred lines of output.

Reply
0 Kudos
Shreyskar
VMware Employee
VMware Employee
Jump to solution

You can pull this information from horizon helpdesk plugin Or through DEM script .Please check Re: what OS is connecting to my VDI environment?

Reply
0 Kudos
RoderikdeBlock
Enthusiast
Enthusiast
Jump to solution

This will include date and time and gives the output as shown.

Connect-HVServer -Server <Your HV Server>

$ViewAPI = $global:DefaultHVServers[0].ExtensionData

$query_service = New-Object "Vmware.Hv.QueryServiceService"

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

$query.queryEntityType = 'SessionLocalSummaryView'

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

$results = $Sessions.Results | ? {$_.Namesdata.ClientType -like "htmlaccess"}

foreach ($session in $results)

{$session | select @{N='UserName';E={$Session.Namesdata.UserName}},@{N='ClientType';E={$Session.Namesdata.ClientType}},@{N='StartTime';E={$Session.SessionData.StartTime}} }

2020-06-30_08-13-05.png

Roderik de Block


Blog: https://roderikdeblock.com
Reply
0 Kudos
HainesFGL
Enthusiast
Enthusiast
Jump to solution

Roderik, This is great!  Thank you!  Using PowerCli for Horizon has been very challenging considering there are only just a few cmdlets.  I'm about to try your latest update to the script.  I'm still curious where this data is being pulled from?  Is it stored in the ADAM DB?  Ideally, in addition to including the date/timestamp, I would like to be able to query this data from a specific time period.  For example from 6/25/20 - 6/30/20.  Is this history stored somewhere?

Thank you again for your help on this!  Great stuff.

Reply
0 Kudos
RoderikdeBlock
Enthusiast
Enthusiast
Jump to solution

Unfortunately this is realtime data. You can create scheduled tasks to collect and filter the data or could go for the suggestions of Shreyskar​.

Roderik de Block


Blog: https://roderikdeblock.com
Reply
0 Kudos
vols11
Enthusiast
Enthusiast
Jump to solution

Hi Haines

I see that your users connect to your Horizon environment through HTML. We are also considering giving this option to our users and would appreciate your advise on this in terms of support and user feedback

Reply
0 Kudos
HainesFGL
Enthusiast
Enthusiast
Jump to solution

Hi Vols11, Sorry for the delayed response.  We do allow HTML access as a convenience.  However, we advise that people use the Horizon Client whenever possible as the their experience will be much better.