Prerequisites
- Mosyle Business admin access
- Configured enrollment key from Runlayer (see below)
Creating an Enrollment Key
Creating an Enrollment Key
Enrollment keys allow devices to automatically register with Runlayer and obtain API credentials.

Navigate to Enrollment Keys
Go to Settings in the Runlayer dashboard and select the Enrollment Keys tab
Configure the Key
- Name (required): Enter a descriptive name (e.g., “Production MDM”)
- Description (optional): Add context about the key’s purpose
Deployment Steps
Generate the Script
Fill in your organization’s settings below to generate a customized deployment script.Mosyle-specific configuration tips:
ENROLLMENT_USERNAME: Use the Mosyle variable%Email%to provide the user’s identity.ENROLLMENT_DEVICE_NAME: Use the Mosyle variable%DeviceName%to identify the device.
Create a Custom Command
- Under the Management tab, select Custom Commands
- Click Add new profile
- Provide a Name (e.g., “Runlayer Hooks”), check Enable variables for this profile, and paste the generated script into the code box
- Switch to the Execution Settings tab and configure the execution frequency
Assign to Devices
Click Add assignment to assign the profile to all devices that should have hooks installed
Verification
Log Locations
| Platform | Log Location |
|---|---|
| macOS | /var/log/runlayer-hooks.log |
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General failure (missing config, enrollment failed) |
| 2 | Network failure |
| 3 | Installation failure |

