VMware Horizon Sync Scripts
  • Dark
  • PDF

VMware Horizon Sync Scripts

  • Dark
  • PDF

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.

Installation Guide

  1. Download the synchronization script Horizon_Sync.ps1 and the Build-CUTree.ps1 from our Github repository.
  2. Create a Windows Task for running the script automatically on the ControlUp Monitor. Arguments for the Task Scheduler in the Input Parameters section below.
  3. Optionally, create an exceptions file. This provides the option to exclude machines, pools, or RDS farms from being synchronized with the CU Console.

Input Parameters

Fully Qualified Domain Name of the Horizon connection server StringYes
Path of the folder where all objects in the ControlUp organization tree are placed. StringYes
Path of the exceptions file that defines DNS names for machines that you don’t want to add to the ControlUp organizational tree.StringNo
PreviewShows expected results without committing any changes to the ControlUp environment (works like the -WhatIf switch in PowerShell).SwitchNo
DeleteEnables the script to execute the removal of objects.SwitchNo
LogFileLog script output to a text file. Can be used with the Preview parameter to log uncommitted changes.SwitchNo
SiteName of the Monitor site where machines are added to.StringNo
Create folders in batches rather than sequentially.SwitchNo
Used for synchronization of the local Horizon Site only.SwitchNo
forceForce folder creation if number exceeds safe limitSwitchNo
SMTP server to send alert emails from
Email address to send alert email from
Email addresses to send alert email to
String ArrayNo
Use SSL to send email alert

Use Case

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.

Was this article helpful?