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.

Prerequisites

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

Name Description Format Mandatory
HVConnectionServerFQDN
Fully Qualified Domain Name of the Horizon connection server String Yes
folderPath
Path of the folder where all objects in the ControlUp organization tree are placed. String Yes
Exceptionsfile
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
batchCreateFolders
Create folders in batches rather than sequentially. Switch No
LocalHVPodOnly
Used for synchronization of the local Horizon Site only. Switch No
force Force folder creation if number exceeds safe limit Switch No
SmtpServer
SMTP server to send alert emails from
String No
emailFrom
Email address to send alert email from
String No
emailTo
Email addresses to send alert email to
String Array No
emailUseSSL
Use SSL to send email alert
Switch No


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.

mceclip1.png

Note: 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:

mceclip8.png

The next step is to find out, which monitor is responsible for our data collection.

mceclip2.png

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 Datacenter\Virtual Desktops\Horizon Demo"  -HVConnectionServerFQDN "cuview71connect.controlup.demo" -logfile "C:\CU Environment Sync Scripts\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

mceclip9.png

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. 

mceclip10.png

 

 

1-on-1 Demo
Schedule now
Price Quote
Get it now
Need a Script?
Get it here
Powered by Zendesk