Export VMware Horizon Sessions to CSV
Export VMware Horizon Session Data into .CSV
This script will export Horizon Session data into a .CSV file in My Documents Folder.
There is no support for this tool - it is provided as-is
Please provide any feedback directly to me - my contact information:
Chris Halstead - Staff Architect, VMware
Thanks to Wouter Kursten for the feedback on supporting over 1,000 sessions.
The code to support that is based off of his post here: https://www.retouw.nl/2017/12/12/get-hvmachine-only-finds-1000-desktops/
This script requires Horizon 7 PowerCLI - https://blogs.vmware.com/euc/2020/01/vmware-horizon-7-powercli.html
Updated January 22, 2021
Update to support over 1,000 Horizon Sessions
This is a PowerShell script that uses PowerCLI and the View-API to query Horizon sessions. The session are written to a table in the script and also to a .CSV file that can be opened in Excel or a similar spreadsheet tool.
- The .csv file is written to the My Documents folder of the user running the script. The file format is: Sessions_Month_Date_Year.csv
Horizon - Sessions.ps1
Login to Horizon Connection Server
Choose 1 to Login to a Horizon Connection Server
Enter the FQDN of the server when prompted to "Enter the Horizon Server Name" hit enter
Enter the Username of an account with Administrative access to the Horizon Server you are connecting to when prompted to "Enter the Username" hit enter
Enter that users Password and click enter
Enter that users Domain and click enter
You will see that you are now logged in to Horizon - click enter to go back to the menu
Return Horizon Sessions
Choose 2 to return Horizon Sessions. They will be written to a table and also to a .CSV file in My Documents.
Note that the location of the .CSV file will be written out after the script executes.