Install-CUAgent: Install an Agent
    • Dark
      Light
    • PDF

    Install-CUAgent: Install an Agent

    • Dark
      Light
    • PDF

    Article summary

    The ControlUp Automation module includes the Install-CUAgent PowerShell cmdlet which allows you to download and install a ControlUp Agent on your local machine. You can either download the agent binaries from the ControlUp Cloud or from a local ZIP file. To install a non-domain joined agent on a workgroup machine, you must provide an API authentication token (API Key) generated from app.controlup.com (DEX).

    If you provide the API Key with the Install-CUAgent cmdlet, it adds the agent machine to your organization tree in the Real-Time DX Console. By default, the cmdlet returns whether the agent was successfully installed or not.

    From ControlUp version 9.0.5 and higher, you can use agent self-registration with either PowerShell cmdlets or our MSI to add the agent machine to your organization tree. For versions lower than 9.0.5, you must use the Console to manually add the agent machine to your organization tree.

    To uninstall the agent from your local machine, use the Uninstall-CUAgent cmdlet. To update an agent, see Invoke-CUAgentUpdate.

    Benefits

    • Download and install agents with no need to use the Real-Time DX Console.
    • Install the MSI directly without using the ZIP file.
    • Install agents on workgroup machines.
    • Automatically register and connect agents to monitors.

    Prerequisites

    • Real-Time DX Console Version 9.0 or higher.
    • If your organization already exists in the Real-Time DX Console, the user you use to install the agent must be a Roles Manager.
    • If your organization doesn’t exist in the console, you must be assigned the DEX Admin role for permission to deploy agents.
    •  For machine requirements, see here.

    Syntax

    Install-CUAgent -Token <string> -InstallationDirectory <string> -FolderPath <string> -InstallAgentManager <boolean> -Site <string> -BrokeringMode <Online/Offline> -MonitorFQDNs <string> -ProxyToControlUpBackend <string> -ProxyToMonitor <string> -ZipFilePath <string> -Version or -Latest <string> -ProxySettings <ProxySettingsObject> -AgentRegistrationKey <string> -AgentPort <Int32> -AgentAuthenticationKey <string> -InstallAsMasterImage <boolean> -AddFirewallRule <boolean> -ConnectionType <string> -Debug <string>
    


    Parameters

    ParameterDescriptionRequired
    -TokenToken string (API Key) generated by web UI for authentication and authorization. If provided, -AgentAuthenticationKey and -AgentRegistrationKey aren't required. If not provided, the current profile's API Key will be used. Note that if the web-generated token isn't provided, the agent won't automatically self-register. For more details, see here.Only if -AgentAuthenticationKey and -AgentRegistrationKeynot provided
    -AgentAuthenticationKeyPublic key to authorize inbound connections to the agent. You can copy the key from the Real-Time Console (Settings > Agent > Agent Authentication Key) or by running the Get-AgentPublicKey cmdlet on your monitor machine.Only if -Token not provided
    -AgentRegistrationKeyPublic key to authorize outbound connections from the agent to the monitors. You can copy the key from the Real-Time Console (Settings > Agent > Agent Registration Key) or by running the Get-AgentRegistrationKey cmdlet on your monitor machine.Only for agent outbound connections, and if -Token not provided
    -AddFirewallRuleAdds an inbound firewall rule to the agent service.No
    -AgentPortSets port for an inbound agent. By default, 40705.  No
    -BrokeringModeIf set toonline, the agent will connect to online brokering service via ControlUp Hybrid Cloud Services. If set to offine, the agent will connect to brokers listed in the registry settings of the agent machines.No
    -ConnectionTypeSets the agent communication to monitors as an Inbound or Outbound connection type. If not provided, will be set to Outbound.No
    -Debug
    Enables agent debugging.
    No
    -FolderPathIf provided with an API Key, the folder path in your organization tree to add the agent to. If provided, but the specified folder doesn't exist, it gets created. If not provided, the latest agent uploaded to the cloud will be installed and added to your root folder. Note that -FolderPath and each folder name must be case-sensitive.No
    -InstallationDirectoryIf provided, you can define a custom installation folder for the agent file. If not provided, the default installation folder will be used. Note that -InstallationDirectory and each folder name must be case-sensitive.No
    -InstallAgentManagerThis optional parameter will be available to use in an upcoming release.No
    -InstallAsMasterImageRelevant only for outbound agents, installs the agent machine as a master image. Not supported for agent self-registration.No
    -LatestSwitch parameter for -Version, latest agent version. If provided, overrides -Version.No
    -ProxySettingsProxy settings that the ControlUp Automation module will use to download the Agent binaries and register the Agent. If not provided, the default system proxy settings will be used.No
    -ProxyToControlUpBackendProxy connection to ControlUp backend.No
    -ProxyToMonitorProxy connection that the agent will use to connect to the monitor services.No
    -SiteAssigns a ControlUp Monitor site name from your organization to the Agent. If not provided, the default site will be used. 

    If you provide a site name that doesn’t exist, the installation fails.

    No
    -VersionSwitch parameter for -Latest, agent version. If not provided, the latest version will be downloaded as a ZIP file from the cloud.No
    -ZipFilePathFull path to the ZIP folder that contains the ControlUp Agent binaries. If not provided, -Version will be used, and the agent version you specified from the cloud will be installed.No

    Install Agent on a Local Machine

    To install a ControlUp Agent on a local machine, follow the steps below.

    1. Open a PowerShell session with elevated permissions and install the module by running the following:

    Install-Module ControlUp.Automation

    The module is automatically imported.

    2. Install the agent:

    Install-CUAgent 
    -Token "[APIKey]" or -AgentAuthenticationKey "[Authentication Key]" -AgentRegistrationKey "[Registration Key]" 

    Example:

    Install-CUAgent 
    -Token "eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjEwNDIzNDcsImlhdCI6MTcI..."

    Install Agent with Self-Registration

    To install an agent using self-registration, follow the steps below.

    1. Open a PowerShell session with elevated permissions and install the module by running the following:

    Install-Module ControlUp.Automation

    The module is automatically imported.

    2. Install the agent and provide the following required parameters:

    Install-CUAgent 
    -Token "[APIKey]" 
    -Site "[SiteName]" 
    -FolderPath "[FolderPathName]"
    -Version "[VersionNumber]"
    

    Example:

    Install-CUAgent 
    -Token "eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjEwNDIzNDcsImlhdCI6MTcI..."
    -Site "American Airlines" 
    -FolderPath "EmployeeSeven\NewFolder"
    -Version "9.0.5.423"

    In the example above, the agent is automatically added to the organization tree in the folder "NewFolder" and assigned to the site "American Airlines." By default, the agent connects outbound to the monitor in the assigned site.

    Uninstall-CUAgent

    Uninstalls the ControlUp Agent from your local machine. If you run the cmdlet with an API Key, it also removes the agent from your organization tree.

    Syntax

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

    Parameters

    ParameterDescriptionRequired
    -TokenToken string (API Key) generated by web UI for authentication and authorization.No
    -ForceUninstalls the agent even if backend errors occur.No
    -DebugEnables agent debugging.No
    -RemainOnOrgTreeIf provided, the agent remains in your organization tree after you uninstall it.No

    Was this article helpful?