Skip to main content
Deploy by RMM

Deploy with ConnectWise Automate

Build a per-client Automate script with one Execute Script step, pilot it on one computer, and schedule it on the client.

Written By The Lemhi Product Team

Last updated 10 days ago

For technicians on ConnectWise Automate. When you're done, the client has its own Automate script with one Execute Script step (PowerShell) that runs on a daily schedule against its computers.

Before you start

  • The client's script. In Engage, open the client, then Shadow AI Usage under Compass, then the Deployment tab. Expand Deploy with your RMM and click Copy script. It already carries this client's key, so paste it unchanged. This guide keeps one copy per client. If you'd rather keep one script, store each client's key in a client-level RMM variable and put that variable in place of the $ClientKey value. The full script and what it does: Deploy the extension with your RMM.

Build the script

  1. Open Automation → All Scripts → New Script (web UI), or the Script Editor in the thick client.

  2. Set Name to Lemhi AI Usage extension - <Client> and Folder to your usual software or deploy folder.

The New Script form in the Automate web UI, with the name and folder filled in
  1. In Then, add a step: Function → Execute Script.

The Execute Script function under Command Execution in the script editor
  1. Set Script type to PowerShell Bypass.

  2. In Script, paste the script you copied from Engage, unchanged.

The Execute Script step in the thick client, with PowerShell Bypass and the script pasted in
  1. Set Variable name to lemhiResult.

  2. Leave "Run as admin" off. The agent runs it as SYSTEM.

  3. Add a Script Log Message step with @lemhiResult@ so the script's readout lands in the script log.

  4. Click Save.

Execute Script reference: ConnectWise docs.

Pilot on one computer

  1. Right-click one computer → Scripts → Run, and pick the script.

The Run script dialog in the Automate web UI, set to run now on one computer
  1. Open Computer → Scripts → Script History (or the script log) to read the output.

  2. Restart the browsers on that computer.

  3. Within a few minutes it appears on the client's Deployment tab.

"Extension not installed yet" is expected until the browser restarts. A failed run (exit code 1) means the key isn't a valid Lemhi key, usually because it was mangled in the copy, or a value didn't read back. Copy the script from Engage again and re-run. If the run fails with does not match what this script wrote, something rewrote the policy keys while the script ran, such as Group Policy, Intune or another RMM job: see Computer doesn't appear on the Deployment tab.

Schedule it on the client

Right-click the client → Scripts → Schedule, or use a group or search scoped to that client's Windows workstations. Repeat daily. Re-runs are safe.

The Run Script dialog in the thick client, scheduled daily against a Windows desktops group

Rotate the key or remove

To rotate the key, regenerate it on the Deployment tab, then click Copy script again: the copied script carries the new key. Paste it over the client's Execute Script step and run it now. See Rotate a client's deployment key.

To remove the extension: Delete the schedule. Build a second script with an Execute Script step holding the removal script and run it on the client. See Remove the extension from a client's computers.

Related