NinjaRMM → Halo PSA GUID Sync — Setup & Operations
Overview
This page documents the setup and ongoing operation of the automated GUID sync between NinjaRMM and Halo PSA. The sync reads the DTC Org GUID custom field from each NinjaRMM organization and writes it to the DTC Client GUID custom field in Halo PSA for all active clients.
Reference Ticket: Halo Ticket #1141374
Why This Exists
Each client org in NinjaRMM has a unique GUID stored in a custom field called DTC Org GUID. This GUID needs to be available in Halo PSA under the DTC Information tab so it can be used for cross-platform automation and identification. This integration syncs it automatically on a weekly schedule.
Components
Halo PSA API Application
- Name: NinjaRMM GUID Sync
- Location: Configuration > Integrations > HaloPSA API
- Auth Method: Client ID and Secret (Services)
- Login Type: Agent — Integrator Agent (SSO accounts are incompatible with client credentials flow)
- Permissions: All enabled
- Client ID:
25542a6d-2d0e-4093-bf82-e11edc64faf6 - Client Secret: Stored in 1Password
NinjaRMM API Application
- Name: Halo GUID Sync
- Location: Administration > Apps > API
- Platform: API Services (machine-to-machine)
- Scopes: Monitoring, Management
- Grant Type: Client Credentials
- Client ID:
0S1xEjce1FQp7Rbn_GJTrSWTp64 - Client Secret: Stored in 1Password
PowerShell Script
- GitHub: DTC-Inc/msp-script-library — integrations/ninja-halo-guid-sync.ps1
- Ninja Field Read:
dtcOrgGuid - Halo Field Written:
CFDtcClientGuid
Scheduled Task
- Location: NinjaRMM > Administration > Scheduled Tasks
- Name: Halo GUID Sync
- Schedule: Weekly
How the Script Works
- Authenticates to both NinjaRMM and Halo PSA APIs using client credentials
- Pulls all organizations from NinjaRMM
- For each org, reads the
dtcOrgGuidcustom field - Searches Halo PSA for a matching client using a three-tier matching strategy:
- Exact name match — preferred
- Fuzzy word overlap match — 60% word overlap threshold
- Manual name mapping table — for clients where names differ significantly between systems
- Writes the GUID to Halo PSA using the
CFDtcClientGuidfield - Outputs a summary of all updated, skipped, and failed clients
Adding Manual Name Mappings
Fixing Name Mismatches Between Ninja and Halo
When the script reports ⚠️ No Halo match for 'Client Name', it means the client exists in Halo but under a different name. The correct fix is to update the client name in NinjaRMM to match exactly what Halo has — not the other way around.
Step 1 — Find the Client's Exact Name in Halo
- Log into Halo PSA at psa.dtctoday.com
- In the left navigation click Customers > Clients
- Use the search bar at the top to search for the client by a keyword (e.g. part of their name)
- Click on the matching client
- Note the exact name shown at the top of the client record — this is what Halo uses as the official name
Step 2 — Update the Name in NinjaRMM
- Log into NinjaRMM at app.ninjarmm.com
- Go to Administration > Organizations
- Search for the client
- Click into the org and click Edit
- Update the Organization Name field to match exactly what Halo shows
- Click Save
Step 3 — Re-run the Sync
Run the script again from PowerShell or wait for the next scheduled run. The client will now match and the GUID will sync successfully.
Note: Always use Halo's naming as the source of truth. Halo is the primary PSA and its client names should be considered canonical.
Adding a New Client
When a new client is onboarded:
- Make sure they are created in both NinjaRMM and Halo PSA
- Ensure the
DTC Org GUIDcustom field is populated in NinjaRMM - The weekly scheduled task will automatically sync the GUID to Halo on the next run
- If needed immediately, run the script manually from PowerShell
Credentials
All API credentials are stored in 1Password under the entry:
Halo/NinjaRMM API - GUID Sync Secret
| Credential | Location |
|---|---|
| Halo Client ID | 1Password — Halo/NinjaRMM API - GUID Sync Secret |
| Halo Client Secret | 1Password — Halo/NinjaRMM API - GUID Sync Secret |
| Ninja Client ID | 1Password — Halo/NinjaRMM API - GUID Sync Secret |
| Ninja Client Secret | 1Password — Halo/NinjaRMM API - GUID Sync Secret |
Do not store plaintext credentials anywhere outside of 1Password or the NinjaRMM script variables.
Credentials
All API credentials are stored in 1Password under the entry:
Halo/NinjaRMM API - GUID Sync Secret
| Credential | Location |
|---|---|
| Halo Client ID | 1Password — Halo/NinjaRMM API - GUID Sync Secret |
| Halo Client Secret | 1Password — Halo/NinjaRMM API - GUID Sync Secret |
| Ninja Client ID | 1Password — Halo/NinjaRMM API - GUID Sync Secret |
| Ninja Client Secret | 1Password — Halo/NinjaRMM API - GUID Sync Secret |
Do not store plaintext credentials anywhere outside of 1Password or the NinjaRMM script variables.
Troubleshooting
| Issue | Resolution |
|---|---|
invalid_client on Halo auth |
Regenerate client secret in Halo > Configuration > Integrations > HaloPSA API > NinjaRMM GUID Sync. Ensure Integrator Agent is set as the login agent — SSO accounts will not work |
invalid_client on Ninja auth |
Verify client ID and secret in Ninja > Administration > Apps > API > Halo GUID Sync |
| Client showing ⚠️ No Halo match | Client name differs between systems — add a manual mapping to the $nameMappings table in the script |
| GUID not showing in Halo after update | Verify field name is CFDtcClientGuid — this is the internal name, not the display label |
| Scheduled task not running | Check NinjaRMM > Administration > Scheduled Tasks and verify the target device is online |