DEVICE AGENT · DEPLOYMENT
5–35 min (by method)
3 phases · 6 steps (the step count shown on the page changes with the chosen method: 6 for Manual and MDM, 5 for RMM, 4 for Other methods)
YOU'LL USE: Dex, macOS
Before you begin
- An admin account (sudo) on targets, or an MDM/RMM agent that runs as root.
- macOS 12 (Monterey) or later: the pkg is universal (Apple Silicon + Intel).
- Outbound HTTPS (TCP 443) from Macs to https://dex365.ai and download.dex365.ai.
- The tenant's enrollment token from the Dex admin portal.
Phase 1: Prepare Dex
Enable the Mac Device app, then generate an enrollment token. One tenant-agnostic pkg for every tenant. The token is always delivered separately.
Step 1: Enable the Mac Device app
1 min · In Dex
Dex only manages Macs when the Mac Device app is enabled in the App Store. Turn it on before enrolling devices. Otherwise the agent connects but Dex has no tools or skills to act on it.
- In the left menu, click App Store.
- Find the Mac Device app card ("macOS device management tools including diagnostics and shell script execution via the Dex Device Agent").
- Check the toggle in the top-right of the card. If it's off, click it to enable the app.
- A green/filled toggle means it's enabled and its Tools and Skills are available to Dex.
Configure app (optional) Configure app on the card opens the app's tools, skills, and autonomy settings. The defaults are fine to start. You can tune what Dex is allowed to do per tool later.
Step 2: Generate an enrollment token in Dex
2 min · In Dex
Sign in to the Dex management console, then go to Settings → Devices. Under Enrollment tokens, generate a new token (or reveal an existing one). This is the value you'll substitute for {{ENROLLMENT_TOKEN}} in every method below. The pkg itself is tenant-agnostic; the token is always delivered separately.
- Open the Dex management console at https://dex365.ai/client/ and sign in.
- In the left menu click Settings, then open the Devices tab.
- Under Enrollment tokens ("Tokens used by the device agent installer to enroll devices"), click Generate Token to create a new one, or reveal an existing token with the eye icon in the Token column.
- Optionally give the token a Name (e.g. "Intune auto-deployment") so you can identify it later, then copy the token value.
- The same panel has a Download macOS agent link (the pkg) and the Connected endpoints table, where devices show up as they enroll.
PKG DOWNLOAD URL (SIGNED + NOTARIZED, UNIVERSAL)
https://download.dex365.ai/macos/DexDeviceAgent.pkg
MANAGED PREFERENCES DOMAIN (ENROLLMENTTOKEN, OPTIONAL BASEURL / USERUPNOVERRIDE)
com.sysaid.dexdeviceagent
How the token reaches each Mac Three mechanisms: a configuration profile setting EnrollmentToken in the com.sysaid.dexdeviceagent managed-preferences domain (best for MDM fleets: the agent re-reads it every ~30 seconds, so token rotation is just a profile re-push), the CLI (sudo DexDeviceAgent --configure --token …, best for SSH and RMM scripts), or the configurator app that opens after an interactive Finder install. Pick the one that matches your method below.
Install order never matters If the pkg installs before a token is available, the daemon idles, logs "Waiting for enrollment configuration", and retries every 30 seconds until one appears.
Pre-configured pkg The Dex admin portal can also generate a per-tenant pre-configured pkg with the token baked in. With that artifact, installing is the only step. Everything else in this guide is identical.
macOS extra: privacy (TCC) permissions Full Disk Access, Accessibility, and Screen Recording power protected-path diagnostics and Computer Use features. Only an MDM-delivered PPPC profile can pre-grant them. Scripts and RMMs cannot. Without it, macOS prompts the logged-in user on first use. Diagnostics and enrollment work fine without them.
Treat the token as a secret Prefer your platform's secret store over hardcoding it in shared scripts, and scope per-tenant .mobileconfig files to the right tenant only. After enrollment the agent exchanges the token for a per-device secret (root-owned) and never logs either. You can Revoke a token any time from the same list.
Phase 2: Deploy
Install the pkg and deliver the token with your chosen method.
HOW DO YOU WANT TO DEPLOY?
- Manual, single Mac (Pilot · ~5 min): One Mac, interactively in Finder or over SSH. Best for pilots, VIP machines, and troubleshooting.
- MDM (Jamf, Intune, Kandji, Mosyle) (Fleet · pre-grants permissions): Pkg + configuration profiles. The only path that can silently pre-grant privacy (TCC) permissions.
- RMM platform (Fleet · fast): NinjaOne, Datto RMM, and any tool that runs bash as root. Pair with MDM for TCC permissions.
- Other methods (SSH · ARD · Munki · ADE): SSH bulk installs, Apple Remote Desktop, Munki, zero-touch (ADE), golden images.
The steps below change based on your choice. Both paths end at the same place.
Variant: Manual, single Mac (Interactive Finder)
HOW ARE YOU INSTALLING? choices: "Interactive (Finder)" (Someone is at the keyboard) and "Headless (terminal / SSH)" (Recommended for scripting).
Step 3: Install and enroll the agent
~5 min · Now in macOS
Install on one Mac, interactively in Finder with the configurator app, or headless from a terminal or SSH session.
- Download and double-click the pkg, then walk through the standard Apple Installer panes. It's signed and notarized, so Gatekeeper opens it without warnings.
- When the install finishes, the configurator opens automatically (DexAgentConfigurator.app).
- Enter the Enrollment token; leave Cloud service URL at the default https://dex365.ai and User UPN override blank (the agent detects the logged-in user).
- Click Save and Enroll and authorize the macOS "wants to make changes" dialog with an admin password.
- The agent enrolls within ~30 seconds and the device appears in the Dex admin portal.
Configurator closed or didn't appear? Relaunch it from /Applications/Dex Device Agent/DexAgentConfigurator.app. If it still doesn't open, the install came from a non-GUI session or a token is already configured. Use sudo … --configure instead.
Step 4: Grant privacy permissions (TCC) (shared by both Manual sub-variants)
(numbered Step 6 on the Manual and MDM variants, Step 5 on RMM, and Step 4 on Other methods) ~2 min · In macOS
On a manually installed Mac there is no MDM to pre-grant TCC permissions, so macOS prompts the logged-in user the first time the agent needs each one, and some grants must be flipped by hand. Diagnostics and enrollment work without them; Computer Use features (screenshots, input control) and protected-path diagnostics need them.
- Open System Settings → Privacy & Security.
- Under Full Disk Access, Accessibility, and Screen Recording, enable DexDeviceAgent.
Fleets avoid the prompts entirely An MDM-delivered TCC profile pre-grants all three permissions silently. Switch to the MDM deployment path for fleet rollouts.
"Background items added" notification (macOS 13+) Cosmetic: it can be suppressed fleet-wide with the background-items profile via MDM.
Step 5: Reconfigure, upgrade, or uninstall (shared by both Manual sub-variants)
as needed · In macOS
Reconfigure an enrolled Mac by running /Applications/Dex Device Agent/DexAgentConfigurator.app (it detects the existing enrollment and offers Reconfigure) or sudo … --configure. To upgrade, install the new pkg the same way: it upgrades in place, restarting the daemon while preserving enrollment and config.yaml. Uninstall with /Applications/Dex Device Agent/Uninstall Dex Device Agent.app, or from the terminal with the commands below.
UNINSTALL (TERMINAL)
sudo "/Library/Application Support/DexDeviceAgent/DexDeviceAgent" --uninstall
sudo rm -rf "/Library/Application Support/DexDeviceAgent" "/Library/Logs/DexDeviceAgent" \
"/var/run/dexagent" "/var/log/dexdeviceagent.log" "/var/log/dexdeviceagent.err" \
"/tmp/dexdeviceagent-helper.log" "/tmp/dexdeviceagent-helper.err"
sudo profiles remove -identifier com.sysaid.dexdeviceagent.config 2>/dev/null
Uninstall removes the device secret Both uninstall paths remove the agent, config, and logs including the device secret. The Mac must re-enroll if reinstalled. Also unscope/remove any MDM-pushed profiles.
Variant: Manual, single Mac (Headless terminal / SSH)
Step 3: Install and enroll the agent
~5 min · Now in macOS
Install on one Mac, interactively in Finder with the configurator app, or headless from a terminal or SSH session.
- Run the commands below: download, silent install, then deliver the token. Replace {{ENROLLMENT_TOKEN}} first.
- Optional --configure flags: --base-url "…" (non-default environments only) and --upn-override "user@domain.com" (report a fixed UPN). Running --configure with no flags starts an interactive prompt that keeps the token out of shell history and ps output.
- Over SSH the configurator app cannot open (no GUI session). The CLI is the only path; this is expected.
INSTALL + CONFIGURE (TERMINAL / SSH)
# Download
curl -fsSL -o /tmp/DexDeviceAgent.pkg 'https://download.dex365.ai/macos/DexDeviceAgent.pkg'
# Silent install
sudo installer -pkg /tmp/DexDeviceAgent.pkg -target /
# Configure (headless equivalent of the configurator app)
sudo "/Library/Application Support/DexDeviceAgent/DexDeviceAgent" \
--configure --token '{{ENROLLMENT_TOKEN}}'
"installer: Error … requires admin" The command wasn't run with sudo: install, --configure, and uninstall all need root.
Steps 4 and 5
Identical to Step 4 (Grant privacy permissions (TCC)) and Step 5 (Reconfigure, upgrade, or uninstall) under "Variant: Manual, single Mac (Interactive Finder)" above; the page shows the same text for both Manual sub-variants.
Variant: MDM (Jamf, Intune, Kandji, Mosyle)
Step 3: Build the per-tenant configuration profile
~5 min · Now in macOS
Every MDM deployment uses the same four artifacts: the pkg, this required per-tenant configuration profile (which carries the enrollment token as managed preferences), the strongly recommended TCC profile, and an optional background-items profile. Build the config profile first. It lands on devices as /Library/Managed Preferences/com.sysaid.dexdeviceagent.plist.
- Save the XML below as dex365-config-<tenant>.mobileconfig.
- Replace REPLACE_ME_ENROLLMENT_TOKEN with the tenant's enrollment token.
- Optionally change BaseURL (default https://dex365.ai) and fill UserUPNOverride. Leave both alone for normal deployments.
- Replace the two PayloadUUID values with fresh UUIDs (run uuidgen once per value) so your MDM tracks the profile identity correctly.
DEX365-CONFIG-<TENANT>.MOBILECONFIG
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>PayloadIdentifier</key>
<string>com.sysaid.dexdeviceagent.config</string>
<key>PayloadUUID</key>
<string>C3D4D9F3-4C32-4196-82A2-CB701F3FB059</string>
<key>PayloadDisplayName</key>
<string>Dex Device Agent — Configuration</string>
<key>PayloadDescription</key>
<string>Provides BaseURL, EnrollmentToken, and UserUPNOverride to DexDeviceAgent.</string>
<key>PayloadOrganization</key>
<string>SysAid Technologies Ltd.</string>
<key>PayloadScope</key>
<string>System</string>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadType</key>
<string>com.sysaid.dexdeviceagent</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>PayloadIdentifier</key>
<string>com.sysaid.dexdeviceagent</string>
<key>PayloadUUID</key>
<string>93FDFF93-FD50-4A00-940E-B2822D565B05</string>
<key>PayloadDisplayName</key>
<string>Dex Device Agent — Settings</string>
<key>PayloadEnabled</key>
<true/>
<!-- Default backend. Override per-tenant if needed. -->
<key>BaseURL</key>
<string>https://dex365.ai</string>
<!-- REPLACE THIS with the tenant's enrollment token. -->
<key>EnrollmentToken</key>
<string>REPLACE_ME_ENROLLMENT_TOKEN</string>
<!-- Optional. Empty = agent detects the logged-in user. -->
<key>UserUPNOverride</key>
<string></string>
</dict>
</array>
</dict>
</plist>
Token rotation = profile re-push Edit the profile with the new token and re-push. Running agents pick it up within ~30 s; already-enrolled devices ignore it (they authenticate with their device_secret). No reinstall, ever.
Ready-made downloads If your Dex admin portal offers profile downloads, use those instead. They are the same files with the token already filled in.
Step 4: Build the TCC and background-items profiles
~10 min · In macOS
The PPPC (TCC) profile pre-grants Full Disk Access (diagnostics over protected paths), Accessibility (Computer Use input control), and Screen Recording (screenshots), silently, with no user prompts. The background-items profile is optional and only suppresses the macOS 13+ "Background items added" notification.
- Extract the agent binary's designated code requirement on any Mac that has the agent installed (command below). The value is the same for every Mac running the same signed release.
- In the TCC XML, paste the one-line output over each <<CODE_REQUIREMENT>> (3 occurrences). macOS silently ignores the grants if it doesn't match.
- Replace the two PayloadUUID values with fresh UUIDs (uuidgen) and save as dex-tcc.mobileconfig.
- Optionally save the background-items XML as dex-background-items.mobileconfig: it matches by launchd label, so it only needs fresh PayloadUUIDs, no code-signing substitution.
EXTRACT THE CODE REQUIREMENT
codesign -d -r- "/Library/Application Support/DexDeviceAgent/DexDeviceAgent" 2>&1 \
| sed -n 's/^designated => //p'
DEX-TCC.MOBILECONFIG (STRONGLY RECOMMENDED)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>PayloadIdentifier</key>
<string>com.sysaid.dexdeviceagent.tcc</string>
<key>PayloadUUID</key>
<string>00000000-0000-0000-0000-000000000001</string>
<key>PayloadDisplayName</key>
<string>DexDeviceAgent — Privacy Permissions</string>
<key>PayloadDescription</key>
<string>Grants Full Disk Access, Accessibility, and Screen Recording to the DexDeviceAgent.</string>
<key>PayloadOrganization</key>
<string>SysAid</string>
<key>PayloadScope</key>
<string>System</string>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadType</key>
<string>com.apple.TCC.configuration-profile-policy</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>PayloadIdentifier</key>
<string>com.sysaid.dexdeviceagent.tcc.policy</string>
<key>PayloadUUID</key>
<string>00000000-0000-0000-0000-000000000002</string>
<key>PayloadDisplayName</key>
<string>DexDeviceAgent TCC Policy</string>
<key>Services</key>
<dict>
<key>SystemPolicyAllFiles</key>
<array>
<dict>
<key>Identifier</key>
<string>com.sysaid.dexdeviceagent</string>
<key>IdentifierType</key>
<string>bundleID</string>
<key>CodeRequirement</key>
<string><<CODE_REQUIREMENT>></string>
<key>StaticCode</key>
<false/>
<key>Authorization</key>
<string>Allow</string>
<key>Comment</key>
<string>Full Disk Access — read /var/log, system events, protected paths</string>
</dict>
</array>
<key>Accessibility</key>
<array>
<dict>
<key>Identifier</key>
<string>com.sysaid.dexdeviceagent</string>
<key>IdentifierType</key>
<string>bundleID</string>
<key>CodeRequirement</key>
<string><<CODE_REQUIREMENT>></string>
<key>StaticCode</key>
<false/>
<key>Authorization</key>
<string>Allow</string>
<key>Comment</key>
<string>Accessibility — computer-use mouse/keyboard automation</string>
</dict>
</array>
<key>ScreenCapture</key>
<array>
<dict>
<key>Identifier</key>
<string>com.sysaid.dexdeviceagent</string>
<key>IdentifierType</key>
<string>bundleID</string>
<key>CodeRequirement</key>
<string><<CODE_REQUIREMENT>></string>
<key>StaticCode</key>
<false/>
<key>Authorization</key>
<string>Allow</string>
<key>Comment</key>
<string>Screen Recording — DarwinScreenCapture frames</string>
</dict>
</array>
</dict>
</dict>
</array>
</dict>
</plist>
DEX-BACKGROUND-ITEMS.MOBILECONFIG (OPTIONAL)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>PayloadIdentifier</key>
<string>com.sysaid.dexdeviceagent.backgrounditems</string>
<key>PayloadUUID</key>
<string>00000000-0000-0000-0000-000000000003</string>
<key>PayloadDisplayName</key>
<string>DexDeviceAgent — Background Items</string>
<key>PayloadDescription</key>
<string>Suppresses the macOS 13+ Background items notification for the agent's LaunchDaemon and LaunchAgent.</string>
<key>PayloadOrganization</key>
<string>SysAid</string>
<key>PayloadScope</key>
<string>System</string>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadType</key>
<string>com.apple.servicemanagement</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>PayloadIdentifier</key>
<string>com.sysaid.dexdeviceagent.backgrounditems.rules</string>
<key>PayloadUUID</key>
<string>00000000-0000-0000-0000-000000000004</string>
<key>PayloadDisplayName</key>
<string>DexDeviceAgent Background Item Rules</string>
<key>Rules</key>
<array>
<dict>
<key>RuleType</key>
<string>Label</string>
<key>RuleValue</key>
<string>com.sysaid.dexdeviceagent</string>
<key>Comment</key>
<string>LaunchDaemon (system-wide)</string>
</dict>
<dict>
<key>RuleType</key>
<string>Label</string>
<key>RuleValue</key>
<string>com.sysaid.dexdeviceagent.helper</string>
<key>Comment</key>
<string>LaunchAgent (per-user helper)</string>
</dict>
</array>
</dict>
</array>
</dict>
</plist>
PPPC grants are MDM-delivered only They only take effect when this profile is delivered by an MDM to a supervised or user-approved-MDM device. A manually installed copy of the profile does nothing.
Step 5: Upload, scope, and pilot in your MDM
~10 min · In macOS
Upload the pkg and the profiles, scope everything to a one-Mac pilot group, verify (next phase), then widen to production. Install order between the pkg and the profiles does not matter. The agent polls managed preferences every ~30 seconds. Other MDMs (Addigy, JumpCloud, Workspace ONE, SimpleMDM, …) follow the identical pattern: custom package + custom profiles, scoped together.
WHICH MDM? choices: Jamf Pro (Packages + policies + profiles), Microsoft Intune (macOS PKG app + custom profiles), Iru (Kandji) (Custom App + Custom Profiles), Mosyle (Custom Packages + Custom Settings).
Sub-variant: MDM > Jamf Pro
- Settings → Computer Management → Packages → upload DexDeviceAgent.pkg.
- Computers → Policies → New: payload Packages → the upload; trigger Recurring Check-in; execution frequency Once per computer. Scope: a one-Mac pilot smart group first.
- Computers → Configuration Profiles → Upload each .mobileconfig (config, TCC, background items). Scope to the same group.
- On a pilot Mac run sudo jamf policy, then verify (next phase).
- Widen scope to production smart groups.
Sub-variant: MDM > Microsoft Intune
- Devices → macOS → Apps → Add: app type macOS app (PKG) → upload DexDeviceAgent.pkg. Included app / bundle ID: com.sysaid.dexdeviceagent. Assign as Required to a device group.
- Devices → macOS → Configuration → Create → Templates → Custom → upload dex365-config-<tenant>.mobileconfig. Deployment channel: Device.
- TCC: upload dex-tcc.mobileconfig as another Custom profile, or rebuild the same grants in the Privacy preferences policy control template (bundle ID com.sysaid.dexdeviceagent, the extracted code requirement, services Full Disk Access / Accessibility / Screen Recording → Allow).
- Optionally add the background-items profile (Custom).
- Assign everything to the same pilot device group; sync a test Mac via Company Portal or wait for check-in.
Sub-variant: MDM > Iru (Kandji)
- Library → Add Library Item → Custom App → upload DexDeviceAgent.pkg (Kandji's default audit/install handling is fine). Assign to a Blueprint.
- Library → Add Library Item → Custom Profile → upload dex365-config-<tenant>.mobileconfig; same Blueprint.
- Repeat Custom Profile for the TCC and background-items profiles.
- Add a test Mac to the Blueprint and verify (next phase).
Sub-variant: MDM > Mosyle
- Custom Packages → Add New Package → upload DexDeviceAgent.pkg; scope to a Device Group.
- Profiles → New Profile (macOS) → Custom Settings → upload dex365-config-<tenant>.mobileconfig; same scope.
- Repeat for the TCC and background-items profiles.
- Force a check-in on a test device and verify (next phase).
Variant: RMM platform
Step 3: Create the universal deployment script
~5 min · Now in macOS
Any RMM that runs a bash script as root can deploy the agent. The universal script below is idempotent, safe to run repeatedly or attach to a recurring policy: it exits fast when the agent is already configured, installs and configures otherwise, then waits up to 3 minutes for enrollment.
UNIVERSAL DEPLOYMENT SCRIPT (BASH, RUNS AS ROOT)
#!/bin/bash
set -euo pipefail
TOKEN='{{ENROLLMENT_TOKEN}}' # or read from an RMM-injected variable (next step)
AGENT='/Library/Application Support/DexDeviceAgent/DexDeviceAgent'
CONFIG='/Library/Application Support/DexDeviceAgent/config.yaml'
if [ -z "$TOKEN" ]; then echo "ERROR: enrollment token not set" >&2; exit 1; fi
# Idempotency: nothing to do if installed and configured
if [ -x "$AGENT" ] && "$AGENT" --has-config; then
echo "Dex agent already installed and configured."
exit 0
fi
# Download + silent install
PKG="$(mktemp -d)/DexDeviceAgent.pkg"
curl -fsSL -o "$PKG" 'https://download.dex365.ai/macos/DexDeviceAgent.pkg'
installer -pkg "$PKG" -target /
# Deliver the token
"$AGENT" --configure --token "$TOKEN"
# Optional: add --base-url '{{BASE_URL}}' for non-default environments only
# Wait for enrollment (the daemon enrolls within ~30 s)
deadline=$(( $(date +%s) + 180 ))
while [ "$(date +%s)" -lt "$deadline" ]; do
if grep -Eq 'device_secret:[[:space:]]*"?[^"[:space:]]' "$CONFIG" 2>/dev/null; then
echo "Dex agent installed and enrolled."
exit 0
fi
sleep 10
done
echo "Installed; enrollment still pending — check token validity and network." >&2
tail -20 /var/log/dexdeviceagent.log /var/log/dexdeviceagent.err 2>/dev/null || true
exit 1
REMOVAL SCRIPT (FOR OFFBOARDING POLICIES)
#!/bin/bash
"/Library/Application Support/DexDeviceAgent/DexDeviceAgent" --uninstall || true
rm -rf "/Library/Application Support/DexDeviceAgent" "/Library/Logs/DexDeviceAgent" \
"/var/run/dexagent" "/var/log/dexdeviceagent.log" "/var/log/dexdeviceagent.err" \
"/tmp/dexdeviceagent-helper.log" "/tmp/dexdeviceagent-helper.err"
profiles remove -identifier com.sysaid.dexdeviceagent.config 2>/dev/null || true
An RMM cannot pre-grant TCC permissions It can install and enroll the agent, but Full Disk Access / Accessibility / Screen Recording can only be pre-granted by an MDM profile. Diagnostics and enrollment work fine without them; Computer Use features prompt the logged-in user until granted. Many shops pair RMM (install + token) with their MDM (TCC profile only).
Recurring policy is the best delivery Attach the script to a recurring policy. It exits fast when already configured, giving automatic coverage and self-healing. Health check one-liner: "/Library/Application Support/DexDeviceAgent/DexDeviceAgent" --has-config (exit 0 = configured); daemon alive = launchctl list | grep com.sysaid.dexdeviceagent shows a PID.
Run as root installer, --configure, and reading config.yaml all require root. For MSPs: one token per customer/site in the platform's scoped variable store, never a shared hardcoded token.
Step 4: Wire it into your RMM and deploy
~10 min · In macOS
Only the TOKEN= line changes per platform: store the token in the platform's secure variable store and read it in the script.
WHICH RMM? choices: NinjaOne (Secure global custom field + automation script), Datto RMM (Masked site variable + component), Another RMM (Atera, ConnectWise, Kaseya, …).
Sub-variant: RMM platform > NinjaOne
- Store the token: Administration → Devices → Global Custom Fields → create dexEnrollmentToken (type Secure, script read access enabled), value set per-organization for MSP tenants.
- Create the script: Administration → Library → Automation → Add → New Script: Language ShellScript (bash), OS Mac, run as System/root. Paste the universal script and replace the TOKEN= line with the snippet below.
- Deploy: run on demand against a device/group, or attach to a policy's scheduled scripts so new Macs get it automatically.
- Monitor: the script output shows the final status line; add a daemon/process monitor on DexDeviceAgent for ongoing health.
REPLACE THE TOKEN= LINE WITH
TOKEN="$(/Applications/NinjaRMMAgent/programdata/ninjarmm-cli get dexEnrollmentToken 2>/dev/null || true)"
Sub-variant: RMM platform > Datto RMM
- Store the token: Sites → (site) → Settings → Variables → add DexEnrollmentToken (masked). Site variables are injected as environment variables, giving MSPs per-site tokens.
- Create a component: Components → New Component → Script: category Applications, script type Bash, runs as root on macOS. Paste the universal script and replace the TOKEN= line with the snippet below.
- Optionally attach DexDeviceAgent.pkg to the component instead of downloading: use PKG="./DexDeviceAgent.pkg" and drop the curl.
- Deploy: Quick Job for ad-hoc installs, or a scheduled Job/Policy targeting the site. Monitor job stdout, plus a process monitor for DexDeviceAgent.
REPLACE THE TOKEN= LINE WITH
TOKEN="${DexEnrollmentToken:-}"
Sub-variant: RMM platform > Another RMM (Atera, ConnectWise, Kaseya, …)
- Atera: Scripts library (Shell, run as root on macOS); token in a script variable / per-customer value.
- ConnectWise Automate/RMM: macOS script/task in system context; token in a client-level EDF / site custom field.
- Kaseya VSA: Agent Procedure → Execute Shell (root); token in a managed variable per org.
- Action1, Level, Syncro, Pulseway, …: bash automation as root; token in the platform's per-customer variable/secret store.
The same rules hold everywhere Run as root; one token per customer/site; attach the script to a recurring policy for self-healing coverage. And TCC still needs an MDM. See the caveat above.
Variant: Other methods
Step 3: Deploy through your channel
varies · Now in macOS
Every method reduces to the same two steps: install the tenant-agnostic pkg silently, then deliver the enrollment token (--configure or an MDM profile).
WHICH CHANNEL? choices: SSH bulk install (A handful of Macs, no platform), Apple Remote Desktop (Install Packages + UNIX command), Munki (Repo import + postinstall), Zero-touch (ADE) (ABM + automated enrollment), Golden image / VDI (Templates and clones).
Sub-variant: Other methods > SSH bulk install
- For Macs reachable over SSH with an admin account, run the loop below from your workstation: it prompts for the token once (kept out of shell history), then installs and configures each host.
- Requires Remote Login enabled on targets (System Settings → General → Sharing) and passwordless or interactive sudo.
SSH BULK INSTALL
#!/bin/bash
read -rs -p "Enrollment token: " TOKEN; echo # avoids plaintext in shell history
for host in mac-001.local mac-002.local mac-003.local; do
ssh "admin@$host" 'sudo bash -s' <<EOF
set -euo pipefail
curl -fsSL -o /tmp/DexDeviceAgent.pkg 'https://download.dex365.ai/macos/DexDeviceAgent.pkg'
installer -pkg /tmp/DexDeviceAgent.pkg -target /
"/Library/Application Support/DexDeviceAgent/DexDeviceAgent" --configure --token '$TOKEN'
echo "\$(hostname) ok"
EOF
done
TCC still prompts Privacy permissions will still prompt the local user on the first Computer Use action. Only an MDM can pre-grant them.
Sub-variant: Other methods > Apple Remote Desktop
- Manage → Install Packages… → add DexDeviceAgent.pkg → select target Macs → install.
- Manage → Send UNIX Command… (run as user root) with the configure command below.
- Verify with another UNIX command: launchctl list | grep com.sysaid.dexdeviceagent.
CONFIGURE (SEND UNIX COMMAND, AS ROOT)
"/Library/Application Support/DexDeviceAgent/DexDeviceAgent" --configure --token '{{ENROLLMENT_TOKEN}}'
Sub-variant: Other methods > Munki
- munkiimport DexDeviceAgent.pkg: the pkg installs silently; installs/receipt detection works out of the box (package id com.sysaid.dexdeviceagent).
- Token delivery: if the Mac also has MDM, prefer the configuration profile from the MDM path. Otherwise add a postinstall_script to the pkginfo (below).
- Add to the target manifests as a managed install.
PKGINFO POSTINSTALL_SCRIPT
#!/bin/bash
"/Library/Application Support/DexDeviceAgent/DexDeviceAgent" \
--configure --token '{{ENROLLMENT_TOKEN}}'
The token lives in the pkginfo Restrict repo access accordingly, or deliver the token via an MDM profile instead.
Sub-variant: Other methods > Zero-touch (ADE)
- For Macs that enroll into MDM out of the box (Apple Business Manager + ADE), nothing special is needed.
- Scope the pkg and the three profiles (config, TCC, background items, see the MDM path) to the enrollment group.
- The agent installs during or right after Setup Assistant, the config profile delivers the token, the TCC profile pre-grants permissions, and the device appears in the Dex portal with no human interaction.
The cleanest fleet path on macOS Zero-touch ADE gives you install, token, and TCC permissions with no user interaction at all.
Sub-variant: Other methods > Golden image / VDI
- In the template: sudo installer -pkg DexDeviceAgent.pkg -target / (and nothing else). Do not run --configure, and ensure config.yaml contains no enrollment_token or device_secret: a baked secret makes every clone identify as the same device.
- At first boot of each clone, deliver the token via MDM profile, RMM script, or a first-boot script. Until then the daemon idles, retrying every 30 s, by design.
Clone detection The agent generates a unique instance_id per installation on first run (cloned-VM detection), but enrollment identity must still come from a post-clone token delivery.
Phase 3: Verify
Confirm the daemon is running, configured, and enrolled.
Step 6: Verify the deployment
(numbered Step 6 on the Manual and MDM variants, Step 5 on RMM, and Step 4 on Other methods) ~2 min · In macOS
Use these deterministic checks after any method. The end-to-end confirmation is the device appearing in the Dex admin portal within a minute of enrollment.
- Daemon running: sudo launchctl list | grep com.sysaid.dexdeviceagent shows a row with a PID.
- Configured: DexDeviceAgent --has-config exits 0.
- Enrolled: config.yaml contains a device_secret: the token is exchanged within ~30 s of enrollment.
- If a profile delivers the token: defaults read "/Library/Managed Preferences/com.sysaid.dexdeviceagent" shows the managed preferences landed.
- The device appears in the Dex admin portal.
VERIFICATION COMMANDS (BASH)
# 1. Installed: binary present
test -x "/Library/Application Support/DexDeviceAgent/DexDeviceAgent" && echo installed
# 2. Daemon loaded and running
sudo launchctl list | grep com.sysaid.dexdeviceagent # row with a PID = running
# 3. Configured: exit 0 iff an enrollment token or device secret exists
sudo "/Library/Application Support/DexDeviceAgent/DexDeviceAgent" --has-config && echo configured
# 4. Enrolled: after success the token is exchanged for a device_secret
# in config.yaml (within ~30 s)
sudo grep -Eq 'device_secret:[[:space:]]*"?[^"[:space:]]' \
"/Library/Application Support/DexDeviceAgent/config.yaml" && echo enrolled
# 5. If a profile delivers the token: confirm managed preferences landed
defaults read "/Library/Managed Preferences/com.sysaid.dexdeviceagent" 2>/dev/null
# 6. Recent logs, if anything above failed
sudo tail -50 /var/log/dexdeviceagent.log /var/log/dexdeviceagent.err
"Waiting for enrollment configuration" in the log No token has reached the Mac. If an MDM profile delivers it, check profiles list and defaults read /Library/Managed\ Preferences/com.sysaid.dexdeviceagent, and the profile scoping in the MDM. Otherwise run sudo … --configure --token ….
Enrollment 401/403 in the log Wrong or expired token. Get a fresh one from the Dex admin portal, re-push the profile or re-run --configure.
Daemon flapping (non-zero exit, no PID) Read /var/log/dexdeviceagent.err: usually a proxy/firewall blocking HTTPS 443. Fix, then sudo launchctl kickstart -k system/com.sysaid.dexdeviceagent.
TCC prompts still appear / Computer Use fails The TCC profile wasn't delivered, the device isn't supervised/UAMDM, or the profile's CodeRequirement doesn't match the installed binary. Re-extract it with codesign and re-push.
Macs enrolled and reporting
The agent is installed and enrolled, and your Macs show up in the Dex admin portal. Dex can now run diagnostics and remediations on them. Roll the same method out to the rest of the fleet, or set up your Windows machines next.