Scripts
The Scripts page lets you upload or paste PowerShell (Windows) or Zsh/Bash (macOS) scripts and schedule them to run across your managed devices. Use scripts for maintenance tasks, data collection, configuration changes, or any custom automation.
Creating a Script
- Go to Scripts in the sidebar.
- Click New Script.
- Fill in the details:
- Name - A descriptive name (e.g., "Cleanup temp files").
- Description - Optional notes about what the script does.
- Shell - PowerShell (Windows), Zsh (macOS), or Bash (macOS). The shell determines which devices can run the script.
- Script - Either Upload file (a
.ps1file for PowerShell, or a.zsh/.sh/.bashfile for macOS shells) or switch to Paste and paste the script body straight into the editor. - Install Context - Choose System (recommended) or User.
- Click Create Script.
Editing a Script
You do not need to delete and recreate a script to change it. Open the script and click Edit (in the page header or on the Script card) to change:
- Name, Description and Install Context.
- The script body, either by editing it in place or with Replace from file to load a new file into the editor.
Click Save Changes. Schedules, collector settings and run history are kept, and devices run the new version on their next scheduled run. The Script card also shows the current body with a Copy button. The shell cannot be changed after creation because it fixes which platform's devices the script targets; to move a script to the other platform, create a new one.
Scheduling a Script
After creating a script, schedule it to run on target devices:
- Click the Schedule button next to the script.
- Configure the schedule:
- Once - Runs one time on the next agent check-in.
- Daily - Repeats every N days.
- Weekly - Repeats every N weeks.
- Select target groups - Choose which device groups should run the script. Use the search bar to find groups, or click Select all to target everything.
- Exclude groups (optional) - Tick any groups whose devices should be skipped even though they are in a target group. Useful when a script targets All Devices and a few devices need to sit it out.
- Click Create Schedule.
Viewing Script Runs
Click the Runs button next to a script to see execution results.
Summary Cards
- Devices - Total devices the script ran on
- Succeeded - Successful executions
- Failed - Failed executions
- Success Rate - Percentage of successful runs
Execution Table
| Column | Description |
|---|---|
| Device | Target device hostname |
| Schedule | Schedule type (Once, Daily, Weekly, or Manual) |
| Next Run | When the script will run again (for recurring schedules) |
| Status | Pending, Succeeded, Failed, Cancelled, Skipped, or Deferred |
| Exit | Exit code from the script |
| Started / Completed | When execution began and finished |
| Logs | Download the log bundle the agent uploaded for that run |
Tips
- Test scripts on a small pilot group before scheduling them across your entire fleet.
- Use System context for scripts that need administrator privileges.
- Use User context for scripts that need to access the logged-in user's profile or settings.
- Check the Runs view after scheduling to verify scripts are executing successfully.
- For recurring scripts, monitor the success rate to catch issues early.