---
title: "PowerShell Cmdlets for Environment Configuration"
slug: "90-powershell-cmdlets"
updated: 2026-02-26T12:58:14Z
published: 2026-02-26T12:58:14Z
canonical: "support.controlup.com/90-powershell-cmdlets"
---

> ## 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.

# PowerShell Cmdlets for Environment Configuration

ControlUp includes the following bundle of PowerShell cmdlets to configure your Real-Time DX environment.

# What They Do

With these PowerShell cmdlets, you can do the following:

- [Install and configure ControlUp Monitors](/tim-reorg/docs/90-powershell-cmdlets#install-and-configure-monitors)
- [Change the Real-Time DX Console security policy](/tim-reorg/docs/90-powershell-cmdlets#change-security-policy)
- [Reassign Monitor partitions](/v1/docs/90-powershell-cmdlets#reassign-monitor-partitions)
- [Allow remediation actions](/tim-reorg/docs/90-powershell-cmdlets#allow-remediation-actions)
- [Manage API keys for ControlUp user profiles](/v1/docs/90-powershell-cmdlets#manage-api-keys)
- [Manage Azure cloud connections](/tim-reorg/docs/90-powershell-cmdlets#manage-cloud-connections)
- [Manage Horizon EUC environment connections](/tim-reorg/docs/90-powershell-cmdlets#manage-horizon-euc-environment-connections)

You can install ControlUp Monitors via the **ControlUp Automation** module. Monitor deployment includes:

- API token-based authentication. The API authentication token ([API Key](/v1/docs/create-an-api-key)) contains the user's email address as well as the organization.
- VDI App integration. You create and manage the API Key using our web interface. This ensures that each API Key is uniquely tied to specific organizational parameters, including the DEX organization ID and the user email address.
- ControlUp.Automation module installation. You install the monitor with the module using the API Key.

For the cmdlets to install and configure ControlUp Monitors, download the ControlUp Automation PowerShell module [here](https://www.powershellgallery.com/packages/ControlUp.Automation).

For the cmdlets to change the security policy, allow remediation actions, and manage cloud and EUC environment connections, see [below](/v1/docs/90-powershell-cmdlets#import-controlup-powershell-module).

### Import ControlUp Automation Module

After you download the module, you can starting using the cmdlets. Run all cmdlets locally on the machine on which you want to deploy, upgrade or uninstall the monitor.

To install and import the **ControlUp.Automation** module, open a PowerShell session as an administrator and run the following:

```powershell
Install-Module ControlUp.Automation
        Import-Module ControlUp.Automation
```

### Import ControlUp PowerShell Module

Before you can start using the cmdlets to change the security policy, allow remediation actions, and manage cloud and EUC environment connections, you must import the **ControlUp.PowerShell.User** module. Note that you must import the **ControlUp.PowerShell.User** module into a separate PowerShell session than the one where you imported the **ControlUp.Automation** module.

Open a new PowerShell session (as an administrator), run the following:

```powershell
$pathToUserModule = (Get-ChildItem "C:\Program Files\Smart-X\ControlUpMonitor\*ControlUp.PowerShell.User.dll" -Recurse | Sort-Object LastWriteTime -Descending)[0]
        Import-Module $pathToUserModule
```

### Install and configure monitors

Run the following cmdlets to install, update, or uninstall a monitor. These cmdlets are from the **ControlUp.Automation** module:

| Cmdlet | Description |
| --- | --- |
| [Install-CUMonitor](/v1/docs/install-cumonitor) | Installs a new ControlUp Monitor on the local machine. |
| [Invoke-CUMonitorUpdate](/tim-reorg/docs/90-powershell-cmdlets#invokecumonitorupdate) | Updates a previously installed 9.0 or higher ControlUp Monitor. |
| [Uninstall-CUMonitor](/tim-reorg/docs/90-powershell-cmdlets#uninstallcumonitor) | Uninstalls ControlUp Monitor from the local machine. |
| [Set-CUMonitorTemplate](/v1/docs/90-powershell-cmdlets#setcumonitortemplate) | Updates a ControlUp Monitor template. |

#### Invoke-CUMonitorUpdate

**Syntax**

```powershell
Invoke-CUMonitorUpdate -ZipFilePath <string> -Version <string> -ProxySettings <ProxySettingsObject>
```

**Description**

To update the existing ControlUp Monitor, you have two options: either supply the ZIP file containing the latest version, or specify the desired version directly using the `-Version` parameter. When using `-Version`, the system automatically downloads the appropriate ZIP file from the ControlUp Cloud and places it on the local machine for installation. Note that upgrading the monitors from version 8.8 with this cmdlet isn’t supported.

| Parameters | Description | Required |
| --- | --- | --- |
| -ZipFilePath | Specify the full path to the ZIP folder containing the ControlUp Monitor installation files. If you don't have the ZIP file, please request it from [our support team](mailto:support@controlup.com). In the absence of this parameter, the latest ControlUp Monitor version (hosted in our cloud) will be used. | No |
| -Version | Full name of the monitor version. If not provided, the latest monitor version is used. | Yes, if no - latest version used |
| -ProxySettings | Proxy settings that the monitor will use to connect to the ControlUp services. If not provided, the default system proxy settings will be used. Example to create proxy settings variable: ```powershell $Secure = Read-Host -AsSecureString $proxys = New-Object -TypeName ControlUp.Automation.ProxySettings $proxys.Password=$Secure $proxys.Address="127.0.0.1" $proxys.Port=80802 ``` | No |

#### Uninstall-CUMonitor

**Syntax**

```powershell
Uninstall-CUMonitor -Token <string> -Force <string> -Debug <string> -RemainOnOrgTree <string>
```

**Description**

Uninstalls the ControlUp Monitor from the local machine. Note that if the ControlUp Agent was installed with the ControlUp Automation module, it will be automatically uninstalled with **Uninstall-CUMonitor**.

| Parameters | Description | Required |
| --- | --- | --- |
| -Token | Token string (API Key) generated by web interface for authentication and authorization. If not provided, the current profile's API Key will be used. | Yes |
| -Force | Uninstalls the monitor even if backend errors occur. | No |
| -Debug | Enables monitor debugging. | No |
| -RemainOnOrgTree | If provided, the monitor remains in your organization tree after you uninstall it. | No |

#### Set-CUMonitorTemplate

**Syntax**

```powershell
Set-CUMonitorTemplate -MonitorName <string> -Template <string> -Token <string>
```

**Example**

```powershell
Set-CUMonitorTemplate -MonitorName ("Monitor1", "Monitor2") -Template "Monitoring" -Token "eyJleHAiOjE3MzkwMDkwMTQsImlhdCI6MTczMTIzMzAxNCwiaXNzIjoiY29udH..."
```

**Description**

Updates the monitor template with no need to use the Real-Time DX Console nor to change registry settings. You must provide the correct name of a monitor that is currently deployed online, with one of the available templates.

| Parameters | Description | Required |
| --- | --- | --- |
| -MonitorName | Name of the ControlUp Monitor | Yes |
| -Template | Name to define the monitor template. Available templates include: - all - backup_coordinator - broker_only - coordinator - datanode - folderagg - monitoring - management - gateway (viewnode) - monitoring_only - indexing_only If empty, the selected template will be **all**. To iterate through all available templates, press **tab**. | Yes |
| -Token | Token string (API Key) generated by web interface for authentication and authorization. If not provided, the current profile's API Key will be used. | Yes |

### Change security policy

Run the following cmdlets to make changes to your security policy:

| Cmdlet | Description |
| --- | --- |
| Add-CUPolicyRoles | Creates new security policy role columns in the **Security Policy** panel with the **Manage Solve** and **Use Web Application** permissions set to Allow. You must configure the **New-CUPolicyRoleDescriptor** cmdlet before you run **Add-CUPolicyRoles**. Possible configurations include adding role members with **New-CUPolicyRoleMember** and configuring permissions set for folder with **New-PolicyRoleAcl**. |
| Get-CUPolicyRoles | Retrieves list of all security policy roles and members. |
| Get-CUPermissionEntries | Retrieves list of all available permission entries. |
| New-CUPolicyRoleDescription | Adds a new policy role Description. |
| New-CUPolicyRoleMember | Adds a new policy role member. |
| New-CUPolicyRoleAcl | Adds a new policy role to the Access Control List (ACL) with permission to open the web interface without entering UPN credentials. |

Example to configure the following two roles:

- **ControlUp Admins**. Built-in role to add new members only.
- **Customers**. Creates new role to add members and to configure the **Manage Solve** and **Use Web Application** permissions.

```powershell
$role=New-CUPolicyRoleDescription -RoleName "ControlUp Admins"
        New-CUPolicyRoleMember -Role $role -SecurityIdentifier 7d1a5930-0739-4eb5-8825-36ee10edd233 -DisplayName "Organization Engineer DW"

        $customer=New-CUPolicyRoleDescription -RoleName "Customers"
        New-CUPolicyRoleMember -Role $customer -SecurityIdentifier d09e999a-29ff-4be3-aeff-384ecf92b1d2 -DisplayName "Organization Customer DW"
        $permissions=@{ `"1B5974A1-3487-4054-8DF9-941318F7E2B6"=$true; ` # Use solve
        "5AD549BF-A0AA-4241-A5F6-B11FFBD21F3A"=$false ` # Manage solve}
        New-CUPolicyRoleAcl -Role $customer -FolderId 00000000-0000-0000-0000-000000000000 -Entries $permissions

        Add-CUPolicyRoles -Roles $role, $customer
```

### Reassign Monitor partitions

Run the following cmdlets from the **ControlUp.PowerShell.User** module to manage partitions or data sources in your ControlUp Monitor cluster. Note that you must run these cmdlets on the same host that Master Monitor runs on.

| Cmdlet | Description |
| --- | --- |
| Get-CUPartitions | View the last state of division of the partitions between monitors or data sources. |
| Set-CuPartitions | Moves a partition or data source to another monitor in the same site. |

**Syntaxes**

```powershell
Get-CUPartitions -ItemType <string> -NodeId <string>
```

```powershell
Set-CUPartitions -Action <string> -PartitionId/-RecordId <string> -TargetNodeId <string>
```

**Description**

Moves a partition or a specific data source from one monitor to another in a deployed monitor cluster. This can save time to reproduce association issues related to moving resources. You can run these cmdlets only on inbound communicating ControlUp Agent​s.

| Parameters | Description | Required |
| --- | --- | --- |
| -ItemType | Type of resource item, see options in table below | Only for `Get-CUPartitions` |
| -NodeId | ID of node | Only for `Get-CUPartitions` |
| -Action | Action to perform | Only for `Set-CUPartitions` |
| -PartitionId | ID of partition | No |
| -RecordId | ID of record | No |
| -TargetNodeId | ID of target node | No |

| -ItemType | Number |
| --- | --- |
| Folder | 0 |
| Computer | 1 |
| RDP | 2 |
| HFolder | 3 |
| Hypervisor | 4 |
| XDFolder | 5 |
| XDSite | 6 |
| AwsFolder | 7 |
| AwsConnection | 8 |
| AwsComputer | 9 |
| AzureConnection | 10 |
| NetScalerFolder | 11 |
| NetScalerConnection | 12 |
| LinuxDataCollectorFolder | 13 |
| LinuxDataCollectorConnection | 14 |
| AzureResourceGroup | 15 |
| Site | 16 |
| Cluster | 17 |
| TreeFolder/Folder/XDFolder/AwsFolder | 18 |

Example to view the current partitions of machines mapping to monitors:

```powershell
Get-CUPartitions -ItemType 1 -NodeId 07236864-e441-48c1-8664-97b54d81ae37
```

Example to move a partition to another monitor in the same site. Note that you can only run this command if the target node belongs to the same site and is different from the node that the moved data source is connected to:

```powershell
Set-CUPartitions -Action Move -PartitionId 1 -TargetNodeId 0f02cc3d-3425-4253-8aa4-770f283083e1
```

Example to move a specific data source to another monitor in the same site:

```powershell
Set-CUPartitions -Action Move -RecordId 1 -TargetNodeId 0f02cc3d-3425-4253-8aa4-770f283083e1
```

Example to assign an unassigned partition and its resources to a target node:

```powershell
Set-CUPartitions -Action Assign -PartitionId 1 -TargetNodeId 0f02cc3d-3425-4253-8aa4-770f283083e1
```

Example to remove a specific data source by its record ID:

```powershell
Set-CUPartitions -Action Remove -RecordId 7e114d99-7824-4976-8648-2935e8918e8b
```

### Allow remediation actions

> [!NOTE]
> 9.1.5 and Higher Update
> 
> From version 9.1.5 and higher, the **Set-MonitorMgmtAllowed** cmdlet is no longer required to allow ControlUp to perform monitor remediation. There is a new checkbox **Enable Automatic Monitor Remediation** that is available in DEX **Settings** > **VDI** where you can opt out. It is selected by default. For details, see [ControlUp Support to Monitor and Remediate Your ControlUp for VDI](/v1/docs/controlup-support-monitor-and-remediate).

Run the following cmdlet allow to our support team to remotely perform remediation actions on your ControlUp Monitor cluster:

| Cmdlet | Description |
| --- | --- |
| Set-MonitorMgmtAllowed | Allows ControlUp to perform remediation actions on monitors. |

**Syntax**

```powershell
Set-MonitorMgmtAllowed -MonitorMgmtAllowed $true
```

### **Manage API Keys**

Run the following cmdlets to manage API Keys for your ControlUp user profiles to enable use of cmdlets on workgroup machines:

| Cmdlet | Description |
| --- | --- |
| Get-CUAPIProfile | Retrieves your current active profile. |
| Set-CUAPIProfile | Enables you to switch between different profiles. Syntax example: ***Set-CUAPIProfile -Profile <org-name>*** |
| Set-CUAPIToken | Stores an API Key in a profile you define. This API Key is only readable by the defined user, and is securely encrypted (Base64-encoded) using DPAPI and saved under **%appdata%\ControlUp\.cuapi.** Syntax example: ***Set-CUAPIToken -Token <XXX> [-Profile “default”]*** |

Your API Keys are securely stored and associated with profile names in the ***.cuapi*** file, for example:

```json
{
        "current": "username-dev",
        "profiles": [
        {
        "name": "default",
        "token": "<encrypted token>"
        },
        {
        "name": "controlup demo",
        "token": "<encrypted token>"
        },
        {
        "name": "username-dev",
        "token": "<encrypted token>"
        }
        ]
```

For more details, see [here](/v1/docs/create-an-api-key).

### Manage cloud connections

Run the following cmdlets to manage cloud connections:

**Note**

You can use following cmdlets to manage Azure cloud connections only.

| Cmdlet | Description |
| --- | --- |
| Add-CUCloudConnection | Creates a new cloud connection with Azure connection type. |
| Get-CUCloudConnection | Retrieves list of all cloud connections. |
| Remove-CUCloudConnection | Removes a connection by unique ID. |
| Update-CUCloudConnection | Updates your existing site with the subscription credentials of another site that you add and configure. |

**Add-CUCloudConnection** **Syntax**

```powershell
Add-CUCloudConnection -Type Azure -TenantId <TenantID> -SiteName <SiteName> -Credentials <Credentials> DataCollectorNames <DataCollector1, DataCollector2> -EnableAvd <$true> -Proxy <ProxyName>
```

For more details about how to use **Add-CUCloudConnection** to add the Azure connection to your organization tree, see [here](/v1/docs/azure-integration-getting-started#add-azure-connection-using-powershell).

### Manage Horizon EUC environment connections

Run the following cmdlets to manage Horizon EUC environment connections:

**Note**

Only Horizon Standard architecture is supported for Horizon EUC environment connection cmdlets, not Cloud Pod Architecture (CPA).

| Cmdlet | Description |
| --- | --- |
| Add-AddHorizonEUCConnection | Creates a new Horizon connection |
| Get-EUCConnections | Retrieves list of all EUC connection |
| Remove-EUCConnection | Removes an EUC connection by unique ID |
| Update-HorizonEUCConnection | Removes the existing Horizon connection |

**Add-AddHorizonEUCConnection Syntax**

```powershell
Add-AddHorizonEUCConnection -ConnectionName <string> -ServerName <string> -Credentials <string> -SiteName <string> -DataCollectorNames <fqdn1,fqdn2,fqdn3> -FailoverList <string[]>
```

**Update-HorizonEUCConnection**

```powershell
Update-HorizonEUCConnection -Id <string> -Credentials <string> -SiteName <string>
```

**Add-AddHorizonEUCConnection Parameters**

| Parameters | Description | Required |
| --- | --- | --- |
| -ConnectionName | Custom name for the creating data source | Yes |
| -ServerName | Connection server name | Yes |
| -SiteName | Name of the site to which EUC Connection should be associated | No |
| -DataCollectorNames | Array of the strings with data collectors | No |
| -FailoverList | List of connection servers | No |
