---
title: "Legacy Horizon on Azure Sync to ControlUp"
slug: "horizon-on-azure-sync-to-controlup"
updated: 2025-07-03T12:02:06Z
published: 2025-07-03T12:02:06Z
canonical: "support.controlup.com/horizon-on-azure-sync-to-controlup"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.controlup.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Legacy Horizon on Azure Sync to ControlUp

:::(Warning) (Important)
Maintenance of the Omnissa Horizon on Azure sync script has been discontinued, and there are known issues with the script. It might not work in your environment.
:::

Using our synchronization scripts, you can automatically populate the ControlUp organizational tree with your Horizon VDI running on the Azure cloud. Our sync script is run as a Windows scheduled task, so that when you add or remove machines, those changes are automatically reflected in your organizational tree. You don't have to make any of those changes manually. When the script is run, your organization reflects your current Horizon VDI for monitoring and remediation.

 * The sync script is written in PowerShell and stored in our [GitHub repository](https://github.com/controlup/environment-scripts/tree/master/Environment_Synchronization_Scripts) .
 * You must run the credentials script twice for the dual authentication required by Horizon Cloud.
 * You set the Windows scheduled task to run the sync script on the ControlUp monitor machine.  

### Prerequisites
 * The sync has to be performed on a machine that has the ControlUp Monitor component installed. You can read about [Adding a ControlUp Monitor](/tim-reorg/docs/adding-a-controlup-monitor).
* The user running the scripts must have a local profile on the ControlUp Monitor machine. Ensure that the same user logs onto the machine at some point before running the scripts.

### 1. Access the scripts from our GitHub repository
You download the sync scripts from our GitHub repository of [environment scripts](https://github.com/controlup/environment-scripts/tree/master/Environment_Synchronization_Scripts) which also includes synchronization scripts for other environments, including Horizon installed on-premises.

 1. Download the following scripts:
**Store credentials.ps1**	  
**Horizon_Azure_Sync.ps1**
**Build-CUTree.ps1**
 2. Copy these scripts to the machine running the ControlUp Monitor. These scrips must reside in the same folder on the Monitor machine.
 3. ***Optionally*** , in a PowerShell window, run this command to see the script's parameters, their descriptions, and default values:
 ```
get-help \&lt; *path to the file* &gt;\Horizon_Azure_Sync.ps1
```

## Input Parameters
Here are the parameters in the sync script **Horizon_Azure_Sync.ps1.**	  These are the parameters to assign when adding the argument in step [3. Set up a Windows Scheduled Task](#3-set-up-a-windows-scheduled-task).
<table style="border-collapse: collapse; width: 98.8799%; height: 338px;" border="1"><tbody><tr style="height: 22px;"><td style="width: 26.3067%; height: 22px;"><strong>Name</strong></td><td style="width: 74.7507%; height: 22px;"><strong>Description</strong></td></tr><tr style="height: 44px;"><td style="width: 26.3067%; height: 44px;"><strong>folderPath</strong></td><td style="width: 74.7507%; height: 44px;"><span>*<strong>Mandatory</strong>. The target folder in the ControlUp organizational tree to save these objects.</span></td></tr><tr style="height: 44px;"><td style="width: 26.3067%; height: 44px;"><strong>preview</strong></td><td style="width: 74.7507%; height: 44px;"><span>Displays the expected results without committing any changes to the ControlUp environment.</span></td></tr><tr style="height: 96px;"><td style="width: 26.3067%; vertical-align: top; height: 96px;"><strong>base</strong></td><td style="width: 74.7507%; vertical-align: top; height: 96px;"><p><span>The base of the URL shown after manual logon to the Horizon Azure admin portal.</span></p><p><span><em>For example i</em><em>n this URL:&nbsp;<span class="wysiwyg-color-blue110">https://cloud-us-2.horizon.<wbr>vmware.com/horizonadmin</span>, the <strong>base</strong> would be <strong>cloud-us-2</strong>.</em></span></p></td></tr><tr style="height: 66px;"><td style="width: 26.3067%; height: 66px;"><strong>delete</strong></td><td style="width: 74.7507%; height: 66px;"><span>Enables the script to execute removing objects from the ControlUp organizational tree. Use with the <strong>Preview</strong> parameter to see the proposed changes before making them.</span></td></tr><tr style="height: 44px;"><td style="width: 26.3067%; height: 44px;"><strong>logfile</strong></td><td style="width: 74.7507%; height: 44px;"><span>Specify a text file to log the output. Can be used for debugging and with the <strong>preview</strong> parameter to see the proposed changes. Log data is appended to this file with each run of the script.</span></td></tr><tr style="height: 22px;"><td style="width: 26.3067%; height: 22px;"><strong>site</strong></td><td style="width: 74.7507%; height: 22px;"><span>Specify a ControlUp Monitor site to assign the objects. Default value: default</span></td></tr><tr><td style="width: 26.3067%;"><div><div><strong>batchCreateFolders</strong></div></div></td><td style="width: 74.7507%;"><div><div><span>Create&nbsp;folders&nbsp;in&nbsp;batches&nbsp;rather&nbsp;than&nbsp;individually</span></div></div></td></tr><tr><td style="width: 26.3067%;"><div><div><strong>force</strong></div></div></td><td style="width: 74.7507%;"><div><div><div><div><span>Force&nbsp;folder&nbsp;creation&nbsp;if&nbsp;number&nbsp;exceeds&nbsp;safe&nbsp;limit</span></div></div></div></div></td></tr><tr><td style="width: 26.3067%;"><div><div><strong>SmtpServer</strong></div></div></td><td style="width: 74.7507%;"><div><div><div><div><div><div><span>Smtp&nbsp;server&nbsp;to&nbsp;send&nbsp;alert&nbsp;emails&nbsp;from</span></div></div></div></div></div></div></td></tr><tr><td style="width: 26.3067%;"><div><div><div><div><strong>emailFrom</strong></div></div></div></div></td><td style="width: 74.7507%;"><div><div><div><div><div><div><span>Email&nbsp;address&nbsp;to&nbsp;send&nbsp;alert&nbsp;email&nbsp;from</span></div></div></div></div></div></div></td></tr><tr><td style="width: 26.3067%;"><div><div><strong>emailTo</strong></div></div></td><td style="width: 74.7507%;"><div><div><div><div><div><div><span>Email&nbsp;addresses&nbsp;to&nbsp;send&nbsp;alert&nbsp;email&nbsp;to</span></div></div></div></div></div></div></td></tr><tr><td style="width: 26.3067%;"><div><div><strong>emailUseSSL</strong></div></div></td><td style="width: 74.7507%;"><div><div><div><div><div><div><span>Use&nbsp;SSL&nbsp;to&nbsp;send&nbsp;email&nbsp;alert</span></div></div></div></div></div></div></td></tr></tbody></table>


### 2. Create the credentials files by running the Store_credentials.ps1 script
The Horizon on Azure Cloud requires dual authentication. To run the scheduled task on the ControlUp Monitor machine, you need both sets of credentials. Therefore you have to run the **Store_credentials.ps1**	  script twice to create those credentials files to access both:  

 * The MyVMware site.
 * The Horizon Cloud Active Directory.

To create the required credentials files:
 1. Access the ControlUp Monitor machine as the user who will be running the scheduled task.
 2. On the Monitor machine, go to the folder where you saved the **Store_credentials.ps1**	  script.
 3. Run a PowerShell prompt.
 4. Run this command:  
```
&amp; '.\store credentials' -credential $null -credentialType  HorizonCloudmyVMware 
```
:::(Info) (***Note:***)
*If you are not in the same folder as where the store_credentials.ps1 script is saved, you must give the full path after the.*
:::
5. When prompted, enter the **User name**	  and **Password**	  to access the MyVMware site.
![Adding credentials to the 'Windows PowerShell credential request' window.](https://cdn.document360.io/098100b7-b9da-4bea-b4b9-017140ab863e/Images/Documentation/360015314518CredentialPromptMyVMware.jpg)
 6. Run this command from the same folder as the script:
```
&amp; '.\store credentials' -credential $null -credentialType    HorizonCloudDomain 
```
 7. When prompted, enter the **User name**	  and **Password**	  as the domain\username used to access the Horizon Cloud site.
![Adding credentials to the Windows PowerShell credential request window.](https://cdn.document360.io/098100b7-b9da-4bea-b4b9-017140ab863e/Images/Documentation/360015314578CredentialPromptCloudDomain.jpg)

Once you have run the script twice, two encrypted .xml files are created in this folder on the ControlUp Monitor machine: **C:\ProgramData\ControlUp\ScriptSupport.**	

The names of those encrypted files include the user who ran these scripts and must be the same user to run the scheduled task. The user who ran the scripts and created these encrypted files is **admingle**.

![ScriptSupport folder showing two files starting with 'admingle'.](https://cdn.document360.io/098100b7-b9da-4bea-b4b9-017140ab863e/Images/Documentation/360015255597CredentialFiles.jpg)


If you are running the scheduled task under a different account, you need to run the script again twice to set up new credentials files as these can be used only by the account that created them on the same machine they were created. 


### 3. Set up a Windows Scheduled Task
Follow the steps in this  [article](/tim-reorg/docs/auto-sync-environment-changes-into-controlup-s-organizational-tree) to create the Windows Scheduled Task. 

In the Windows Local Security Policy, ensure that this user’s role has **Log on as a batch job**	  properties.
![Log on as a batch job Properties window showing CONTROLUP\ControlUp Service Accounts.](https://cdn.document360.io/098100b7-b9da-4bea-b4b9-017140ab863e/Images/Documentation/360015314878LogOnAsABatch.jpg)
The credential tasks are set to run powershell.exe with these command lines for the create and delete tasks respectively:
```
-ExecutionPolicy RemoteSigned -NoLogo -File "C:\CU Environment Sync Scripts\Horizon_Azure_Sync.
ps1"   -folderPath "\Datacenter\Virtual Desktops\Horizon Cloud"   -logfile "C:\CU Environment Sync Scripts\HZ Azure Sync.log" -base "cloud-us-2"
```
```
-ExecutionPolicy RemoteSigned -NoLogo -File "C:\CU Environment Sync Scripts\Horizon_Azure_Sync.
ps1"   -folderPath "\Datacenter\Virtual Desktops\Horizon Cloud"   -logfile "C:\CU Environment Sync Scripts\HZ Azure Sync Deletes.log" -base "cloud-us-2" -Delete
```
