Ingesting Custom Script Results from Managed Devices
Harmony lets you ingest the results of custom scripts running on managed devices directly into the platform for asset discovery and data enrichment. This ingestion path works with any MDM solution - including Kandji, JumpCloud, and others - so you are not limited to natively supported integrations.
When a script runs on a managed device, its standard output is automatically captured, compressed, and uploaded to Harmony using secure, authenticated requests. No extra configuration is required inside the script itself.
How It Works
The ingestion flow has two main parts:
Script execution - Your MDM schedules and runs a script on managed devices as it normally would.
Result upload - The script's standard output is redirected to a temporary file, compressed, and sent to Harmony using an access key for authentication.
This approach keeps transfers efficient and ensures that only trusted devices can submit data to your Harmony environment.
Prerequisites
Before setting up custom script ingestion, make sure you have:
An active Harmony account with asset management permissions.
An access key generated from the Harmony settings. Access keys are used to authenticate upload requests from your scripts.
An MDM solution capable of deploying and scheduling scripts on managed devices (any MDM platform is supported).
Setting Up Access Key Authentication
Access keys ensure that only authorized devices can submit script results to Harmony. To generate an access key:
Navigate to Settings in Harmony.
Open the Access Keys section.
Select Create Access Key and give it a descriptive name so you can identify which integration it belongs to.
Copy the generated key and store it securely - you will reference it in the upload step of your script.
Keep your access key confidential. If a key is compromised, rotate it immediately from the same settings page.
Writing a Custom Script
Your script does not need any special logic to handle uploads. Harmony captures standard output automatically. Focus the script on collecting the data you want - hardware inventory, installed software, configuration details, or any other asset information.
A typical script structure looks like this:
Collect the data you need (for example, system profiler output, installed package lists, or custom inventory fields).
Print the results to standard output.
Exit cleanly.
The upload wrapper handles compression and transmission after your script finishes.
Automatic Result Capture and Upload
When the script runs on a managed device, Harmony's upload mechanism:
Redirects standard output to a temporary file on the device.
Compresses the file before transmission to keep the payload small and transfers fast.
Sends the compressed result to Harmony using your access key in the authentication header.
This happens automatically without any changes to the script itself. Once the data arrives in Harmony, it is processed and made available for asset discovery and enrichment.
Supported MDM Platforms
This ingestion method works alongside any MDM solution. Platforms that have been validated include:
Kandji
JumpCloud
Any other MDM capable of running shell or Python scripts on managed endpoints
If your MDM can deploy a script and schedule its execution, it is compatible with this feature.
Firewall and Network Considerations
The upload uses standard HTTPS outbound traffic, making it compatible with most corporate firewall policies without requiring special rules. Ensure managed devices can reach the Harmony API endpoint on port 443.
Troubleshooting
Upload fails with an authentication error
Access key is missing or incorrect
Verify the key in your script matches the one generated in Harmony settings
No results appear in Harmony after script runs
Script produced no standard output
Confirm the script prints output and exits with a zero status code
Compressed file is empty
Script exited before producing output due to an error
Check the script's error output via your MDM console for runtime failures
Data appears in Harmony but fields are not enriched
Output format is not recognized
Review the expected output format in the Harmony documentation for your script type
Next Steps
Review the asset discovery dashboards in Harmony to confirm ingested data is appearing correctly.
Schedule your script on a recurring basis through your MDM to keep asset data up to date.
Use access key rotation as part of your regular security hygiene to minimize exposure.
Last updated
Was this helpful?
