Connection (Session) Duration Report: Best Solution for VMware Horizon View 7.x or Newer
VMware Horizon View provides solutions for remote working and access to business from anywhere. Users be able to use virtual desktop or applications via secure and fast display protocols such as PCoIP or VMware Blast. VMware did support monitoring VMware Horizon View via vRealize Operations (vROps) for Horizon but recent versions are not supported. You have to use third-party software or services such as ControlUp or develop your solutions.
I had to choose second choice and developed the solution by PowerShell, also you can use it with considering some conditions.
What Are Conditions?
If you want to use this PowerShell script, you must aware that:
- Users should have at least one “Connect” or “Disconnect” or “Reconnect” during past 24 hours (00:00 – 23:59:59).
- If user just has one “Connect”, the duration will be calculated from “Connect” event time till end of day. If user just has one “Disconnect”, the duration will be calculated from begin of day till “Disconnect” time.
- Idle session duration couldn’t be detecting.
- PowerShell script analyze result of SQL query and you can change the query as you wish.
What’s Data Source?
The data source is VMware Horizon View event database, so you should have it and configure it on Connection servers.
The Script for Generate Connection Duration Report
Change the below values with something that you want or you have:
- DOMAIN: Change it with your domain name.
- domain.org: Change it with your domain FQDN.
- Session Type: Desktop is default but you can remove it or add another condition to that.
- Output File Address: The last line must be changed.
How To Run?
You can run the script on database server locally but if you want to run from remote computer, you should do some changes on script.
My favorite: SQL Server Agent Job (You should make sure about permission on target folder)