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
IfWhen athe script reports ⚠️ No Halo match for 'Client Name', it means the client exists in both systemsHalo but hasunder a different name,name. addThe 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
$nameMappingsmatching $nameMappingsrecord =— @{this "Ninjais Orgwhat Name" = "Halo Clientuses Name"as }the official name
Step 2 — Update the Name in NinjaRMM
Step 3 — Re-run the Sync
Then updateRun the script inagain GitHubfrom PowerShell or wait for the next scheduled run. The client will now match and re-run.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. Do not store plaintext credentials anywhere outside of 1Password or the NinjaRMM script variables.
| Credential | Location |
|---|---|
| Halo Client ID | 1Password |
| Halo Client Secret | 1Password |
| Ninja Client ID | 1Password |
| Ninja Client Secret | 1Password |
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 |