VMware Horizon Sync Scripts
    • Dark
      Light
    • PDF

    VMware Horizon Sync Scripts

    • Dark
      Light
    • PDF

    Article summary

    Important

    The maintenance of the VMware Horizon sync script has been discontinued. If you're using ControlUp version 8.6.5 or higher, we recommend using the Universal sync script instead.

    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

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

    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.
    4403658548369mceclip1.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:
    4403669872145mceclip8.png

    The next step is to find out, which monitor is responsible for our data collection.
    4403644497553mceclip2.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 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.
    4403662855953mceclip9.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.
    4403662920593mceclip10.png


    Was this article helpful?