VMware Horizon Sync Scripts
ControlUp is committed to ensuring you - the ControlUp user - have the best system monitoring experience possible. We understand the importance of reflecting changes in your VMware Horizon environment in the ControlUp Console. Therefore we have developed synchronization scripts that let you automatically reflect those changes in the ControlUp Real-Time Console.
To use our synchronization scripts, there are some prerequisites that must be considered. These preconditions are explained in greater detail in the Prerequisites for Running Horizon Sync scripts article.
- Download the synchronization script Horizon_Sync.ps1 and the Build-CUTree.ps1 from our Github repository.
- Create a Windows Task for running the script automatically on the ControlUp Monitor. Arguments for the Task Scheduler in the Input Parameters section below.
- Optionally, create an exceptions file. This provides the option to exclude machines, pools, or RDS farms from being synchronized with the CU Console.
|Fully Qualified Domain Name of the Horizon connection server||String||Yes|
|Path of the folder where all objects in the ControlUp organization tree are placed.||String||Yes|
|Path of the exceptions file that defines DNS names for machines that you don’t want to add to the ControlUp organizational tree.||String||No|
|Preview||Shows expected results without committing any changes to the ControlUp environment (works like the -WhatIf switch in PowerShell).||Switch||No|
|Delete||Enables the script to execute the removal of objects.||Switch||No|
|LogFile||Log script output to a text file. Can be used with the Preview parameter to log uncommitted changes.||Switch||No|
|Site||Name of the Monitor site where machines are added to.||String||No|
|Create folders in batches rather than sequentially.||Switch||No|
|Used for synchronization of the local Horizon Site only.||Switch||No|
|force||Force folder creation if number exceeds safe limit||Switch||No|
SMTP server to send alert emails from
Email address to send alert email from
Email addresses to send alert email to
Use SSL to send email alert
Our VMware Horizon environment contains different Desktop Pools, as shown below. Our goal for this use case is to hide the ek_test_pool folder from the CU Console view.
The screenshot above shows the desktop pools that are maintained on the specific server. The script does not add / remove folders from the EUC Environments folder as this read-only!
The desktop pools in our CU Console tree are located in different folders:
The next step is to find out, which monitor is responsible for our data collection.
Once you identified the monitor, connect remotely to this machine and create the Windows Task as explained in this article. For our use case we will use the following arguments:
-ExecutionPolicy RemoteSigned-NoLogo-File "C:\CU Environment Sync Scripts\Horizon_Sync.ps1"-folderPath "controlup demo\IL Datacente r\Virtual Desktops\Horizon Demo"-HVConnectionServerFQDN" cuview71connect.controlup.demo" -logfile "C:\CU Environment Sync Scrip ts\Horizon Sync.log" Exceptionsfile "C:\CU Environment Sync Scripts\demo_exceptions.txt"
The demo_exceptions.txt that is used in the argument consists of several folders, for example, the ek_test_pool.
The script checks all folders that are found in the provided folderpath parameter, in our case controlup demo\IL Datacenter\Virtual Desktops\Horizon Demo, and excludes all folder names that are saved in the demo_exceptions.txt file.
Run the task in the Task Scheduler manually or wait for the automated schedule. Once completed, the ek_test_pool is not shown anymore in our CU Console tree.