PowerShell Cmdlets for Environment Configuration
    • Dark
      Light
    • PDF

    PowerShell Cmdlets for Environment Configuration

    • Dark
      Light
    • PDF

    Article summary

    ControlUp Versions 9.0 and higher include the following bundle of PowerShell cmdlets to configure your Real-Time DX environment.

    What's New?

    With these PowerShell cmdlets, you can do the following:

    Before version 9.0, you were required to install monitors using the Real-Time DX Console. Now, you can deploy via the ControlUp Automation module. The updates include:

    • API token-based authentication. The API authentication token (API Key) contains the user's email address as well as the organization.

    • Web UI integration. You create and manage the API Key using our web UI. 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.

    For the cmdlets to change the security policy, allow remediation actions, and manage cloud and EUC environment connections, see below.

    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:

    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:

    $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

    Cmdlet

    Description

    Install-CUMonitor

    Installs a new ControlUp Monitor on the local machine.

    Invoke-CUMonitorUpdate

    Updates a previously installed 9.0 or higher ControlUp Monitor.

    Uninstall-CUMonitor

    Uninstalls ControlUp Monitor from the local machine.

    Set-CUMonitorTemplate

    Updates a ControlUp Monitor template.

    Invoke-CUMonitorUpdate

    Syntax

    Invoke-CUMonitorUpdate -ZipFilePath <string> -Version or -Latest <string> -ProxySettings <ProxySettingsObject>

    Description

    To update the existing 9.0 or higher 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, however, that upgrading the monitors from version 8.8 with this cmdlet isn’t supported yet.

    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. In the absence of this parameter, the latest ControlUp Monitor version (hosted in our cloud) will be used.

    No

    -Version

    Switch parameter for -Latest, full name of the monitor version.

    Yes, if no -Latest

    -Latest

    Switch parameter for -Version, latest monitor version. If provided, overrides -Version.

    Yes, if no -Version

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

    $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

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

    Description

    Uninstalls the ControlUp Monitor from the local machine.

    Parameters

    Description

    Required

    -Token

    Token string (API Key) generated by web UI 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

    9.1 Beta Feature

    Note that the Set-CUMonitorTemplate cmdlet is available only in version 9.1 beta.

    Syntax

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

    Example

    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 UI 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 UI without entering UPN credentials.

    Example below 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.

    $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 

    Allow remediation actions

    Run the following cmdlet allow 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

    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:

    {
        "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.

    Manage cloud connections

    Run the following cmdlets to manage cloud connections:

    Note

    From version 9.0 and higher, you can use these 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:

    Add-CUCloudConnection -Type Azure -TenantId <TenantID> -SiteName <SiteName> -Credentials <Credentials> DataCollectorNames <DataCollector1, DataCollector2> -EnableAvd <1/true> -Proxy <ProxyName>

    For more details about how to use Add-CUCloudConnection to add the Azure connection to your organization tree, see here.

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

    Remove-EUCConnection

    Removes an EUC connection by unique ID.

    Update-HorizonEUCConnection

    Removes the existing Horizon connection.


    Was this article helpful?