List all the active VMware Horizon client versions that are used

Before upgrading a VMware Horizon environment I want to known what VMware Horizon Client versions are in use.  Just to be sure that the VMware Horizon clients are supported when upgrading to a new VMware Horizon version.

Another use-case is to identify the VMware Horizon Client versions that are in use for security releated issues.  In the VMware Horizon Administrator you can allow what VMware Horizon client versions are able to connect.

The following script displays all the VMware Horizon sessions and the VMware Horizon client version that is used to connect to the VMware Horizon environment.

Make sure that the VMware.HV.Helper module is installed (Link).

<#
.SYNOPSIS
    HorizonClient.ps1.ps1
.VERSION
    1.0
.DESCRIPTION
    List all the Connection and displays the VMware Horizon client version. 
.NOTES
    Author(s): Ivo Beerens
    Requirements:  
        Make sure the VMware.HV.Helper module is installed, see: https://github.com/vmware/PowerCLI-Example-Scripts
        Copy the VMware.Hv.Helper to the module location.
.EXAMPLE
    PS> ./HorizonClient.ps1
#>

# Variables
$connectionserver = 'srv-con-01'
$domain = 'lab.local'
$date = Get-date -UFormat "%d-%m-%Y"
$output = "C:\Temp\horclients-$date.csv"

# Import module
Import-Module VMware.Hv.Helper

Write-Output "", "Connecting to the Horizon Connection Server"
Connect-HVServer -Server $connectionserver -domain $domain

# List all Users and clients with the Horion client the are running
$localsessioninfo = (get-HVlocalsession).Namesdata | Select-Object UserName, MachineOrRDSServerName, AgentVersion, DesktopPoolCN, ClientType, ClientAddress, ClientName, ClientVersion, SecurityGatewayDNS, SecurityGatewayAddress | Sort-Object ClientVersion

# Export the output to a grid and CSV file
$localsessioninfo | Out-GridView -Title 'VMware Horizon Client versions'
$localsessioninfo | export-csv $output -Force -NoTypeInformation

Disconnect-HVServer * -Confirm:$false

This script (HorizonClients.ps1) can be found on my GitHub repo (Link)

Get the highest concurrent license usage from a VMware Horizon environment

In some managed VMware Horizon environments, I wanted to know the highest concurrent users per month. This information can be found in the Horizon Administrator Console under Settings -> Product Licensing and Usage -> Usage.

Using the VMware Horizon Administrator console is a manual task. I wanted to automate this. To automated this use VMware PowerCLI which supports access to the View API.

To automate retrieve thehighest concurrent users per month perform the following steps:

  • Setup the Horizon PowerCLI module, link
  • The following PowerCLI code display the highest concurrent license usage
Import-Module -Name VMware.VimAutomation.HorizonView
Connect-HVServer -Server <server> -Domain <domain name>

# Clear screen
Clear

# View API
$horapi = $Global:DefaultHVServers.ExtensionData

# Get the highest concurrent licensing usage
$getusage = $horapi.UsageStatistics.UsageStatistics_GetLicensingCounters()
$totalccu = $getusage.HighestUsage.TotalConcurrentConnections
Write-Output " "
Write-Output "The highest concurrent usage count is: $totalccu"

  • To reset the highest concurrent license usage use the following code
# Reset the highest license usage
$horapi.UsageStatistics.UsageStatistics_ResetHighestUsageCount()
$totalccu = $getusage.HighestUsage.TotalConcurrentConnections
Write-Output "The highest usage count is: $totalccu"

By using this code you can create a scheduled task to get the highest concurrent license usage at the end of each month and perform a reset after it for example. So you know what is the highest concurrent license usage is that is connected to the VMware Horizon environment.

Enable Adobe Flash support for the VMware Horizon Administrator console

Adobe Flash is no longer supported after December 31, 2020, and currently disabled by default.

During my consulting work, I still see organizations that use Adobe Flash-based applications such as the VMware Horizon Administrator. VMware Horizon 7.10 has an HTML5 based Horizon Console that nearly feature-complete and replaces the Adobe Flash-based Horizon Console.

For organizations, it can difficult to manage there VMware Horizon environments below version 7.10 of VMware Horizon. This can be done by enabling Adobe Flash temporarily. Caution: Enabling Adobe Flash is a security breach for your environment. So use with caution!!!

With the following steps you can enable Adobe Flash support on a Windows:

  • Download Firefox 78.6.1 ESR, link
  • Create or edit the following file: ‘C:\Windows\SysWOW64\Macromed\Flash\mms.cfg’ with the following settings:
EOLUninstallDisable=1
SilentAutoUpdateEnable=0
EnableAllowList=1
AutoUpdateDisable=1
ErrorReportingEnable=1
AllowListUrlPattern=https://fqdn-of-the-horizon-connection-server:443
  • Replace the ‘AllowListURLPattern’ with the FQDN of the VMware Horizon Connection server or load balancer URL
  • Open Firefox and enter the VMware Horizon Connection server or load balancing URL

When you are still using the VMware Horizon Administrator make sure to upgrade your VMware Horizon environment. The end of general support for Horizon 7 is March 2021. Upgrade to minimal VMware 7.13 (has general support till October of 2022) or VMware Horizon 8.x.