Team: Huntress Managed Endpoint Detection and Response
Product: Datto RMM
Environment: Windows (macOS version here)
Summary: Installing the Huntress agent using Datto RMM.
Note: If you previously used an older version of this script that did not use the Datto Site Name to map organizations, you may see duplicate organizations when you switch to this version. To clean this up, move the agents from the old organization into the new one that matches the Datto Site Name, then delete the old organization from the Huntress portal.
Overview
Setup steps
2 Datto: Set global variable (HUNTRESS_ACCOUNT_KEY)
3 Datto: Add Huntress component (ComStore)
4 Datto: Create deployment job
5 Huntress: Verify agents appear
Deployment video
(Datto-specific info starts at 07:00)
How Datto maps organizations
This deployment component doesn’t ask for a Huntress Organization Key. Instead, it uses information already in Datto:
- The
HUNTRESS_ACCOUNT_KEYglobal variable for your Huntress Account Key. - The Datto RMM Site Name as the Huntress Organization Name.
Behind the scenes, Datto exposes the Site Name in an environment variable called CS_PROFILE_NAME. The component reads that value and sends it to Huntress as the organization name.
- If that organization already exists in Huntress, new agents are added to it.
- If it doesn’t exist yet, Huntress automatically creates a new organization with that Site Name and assigns the agents there.
If Datto doesn’t send a Site Name for a device (for example, CS_PROFILE_NAME is missing), the installer can’t tell which organization name to use. In that case, the agent goes into a temporary organization called MISSING_CS_PROFILE_NAME in Huntress.
You can move those agents into the correct organization from the Agents page in the Huntress portal once you’ve confirmed where they belong.
Variable mapping
- Datto RMM
HUNTRESS_ACCOUNT_KEYvariable → Huntress Account Key (manually retrieved from the Huntress portal). - Datto RMM Site Name (
CS_PROFILE_NAME) → Huntress Organization Name.
Huntress: Copy Account Key
- In the Huntress Portal, click the "hamburger" menu in the top right corner then select Download Agent
-
Click the Copy button beside the Account Secret Key
Datto: Set global variable (HUNTRESS_ACCOUNT_KEY)
- Once copied, log in to Datto RMM. From the main page, click Setup and select Global Settings.
- Scroll down to Variables, then select Add Variable.
- Under Value, paste the Account Key copied from the Huntress portal.
- Under Name, type
HUNTRESS_ACCOUNT_KEY. - Select Save, then OK.
Datto: Add Huntress component (ComStore)
- On the Left Menu, select Automation then ComStore
- Seach for Huntress by name, then select Add
Datto: Create deployment job
- Under Automation, Select Jobs
- Type in a name, Select Add Component
- Search for Huntress, Select Add
- Leave variables boxes blank, select Add Target
- Find and Add Target devices
- Select Deployment Schedule options then Scroll down to Create Job
Huntress: Verify agents appear
- After the Scheduled Job runs, wait 5-10 minutes then, in Huntress select the home icon and see the number of Total Agents installed.
Datto: Confirm job success
You can check for deployment errors by viewing the job status.
- Navigate to the Jobs tab > Competed Jobs tab > click on the job
- On job view, click the "stdout" and "stderr" buttons to view the log from any agent that may have failed to aid in troubleshooting.
Troubleshooting
Note: In rare cases, the Datto install script may not honor the wait command in our deployment PowerShell. This can cause Datto RMM to report that the agent installation failed even though it completed successfully (Datto isn’t always waiting for the install to finish before checking status). We’re actively working with Datto on this behavior. If you’re seeing failures in Datto but agents appear in Huntress, or if you’re having trouble with deployment, contact support@huntress.com.
The "Stdout" field under the completed scripts will show each step performed:
If the agent does not install correctly, there are options within the DattoRMM Huntress Install Script to reinstall the agent and/or force it to reregister. Repeat the steps in Scheduling the Script to Run, but after Step 3., select the options for "reinstallAgent" OR "registerAgent:"
Need something else?
The Datto RMM Huntress install script is written in PowerShell. You can view the source here.
If you need any assistance from Huntress, or if you notice a step that's missing, please contact us at support@huntress.com.
If not all expected machines appear, start by troubleshooting with these articles: