Automate Agent - Reinstall
Summary
This script is used to perform a full uninstall and reinstall of the CWA Agent on the target machine through the ConnectWise Control RMM+ add-in.
Time Saved by Automation: 5 Minutes
Sample Run
Target: Windows and Mac agents
Dependencies
- Script - Automate Agent - Auto Repair
- RMM+ Plugin Configuration
- Script - ScreenConnect Client - Connectivity - Audit*
- Script - ScreenConnect Client - Command - Execute*
- Agent - Generate Location Installer URL*
System Properties
| Name | Example | Required | Description |
|---|---|---|---|
| RMMPlus_AccessKey | ajw8fh2p93ufn;o31ifu2091j23oif | True | This is the key set up in the CW Control RMM+ Plugin so Automate can reach out to gain access to the API. |
| RMMPlus_Headers | Origin:site.site.com | True | This is the URL (without http/https) for the CW Control server. This value needs to match the value in the RMM+ Plugin configuration in CW Control. |
| RMMPlus_StaleAgentThreshold | 30 | True | The number of days to indicate what a "stale" agent is to the scripts. 30 is the default. |
| RMMPlus_Timeout | 1000 | True | The default timeout for commands run via RMM+ through Automate. 1000 is the default. |
Output
- Script log messages only.
Changelog
2026-04-06
- Forked Labtech Module to our github
- Code Signed Module to avoid getting blocked by security applications
2026-02-04
- Increased the timeout for the reinstall command
2025-12-29
- The script was failing to repiar the agent. Therefore, we modified the reinstall command to kill msiexec process before initiating the process and updated the timeout for the command
2025-04-10
- Initial version of the document