Scripts
SimpleMDM supports the ability to run remote scripts on devices without requiring a third-party agent to be installed to deploy them.
Creating A Script
To create a new script:
- Click Scripts in menu on the left side of the screen.
- Click "Create Script".
- Give the script a meaningful name.
- Click "Choose File" and upload your script file, or type/paste your script directly into the text editor field.
- Click Save.
Once you have created your script, you will be able to use it to create a job to run on your devices.
A Note On Restarts
If your script contains a reboot, shutdown, or similar command, SimpleMDM won't be able to detect whether or not that script has completed. The script, however, will not be re-run. As a result, there is no risk of a loop.
Creating A Job
To create a job to run a script:
- Click Jobs under the Scripts section of the menu.
- Click "Create Job".
- Click the "Script" dropdown and select the name of a script that you have previously created.
- In the "Run On" field, type the names of any assignment group (from the Assignments page), device group, or individual devices that you would like to run the script on.
- Once you have selected the devices or groups you want to run the script on, click "Run".
View Job Information
You can view information any jobs that you have run under the Jobs page. Click the ID to view more information. On the Job Details page, you can see information such as:
- Script name
- "Created At" timestamp
- Which user created it
- How many devices it was run on
- Job Status (Pending, Success, Error)
Click the Devices tab to view the devices that it was run on. Click the Script tab to view the script itself.
Script Response Messages
SimpleMDM will store the response message output and code that a script generates. To view the output, visit the Job Details screen, navigate to the Devices tab, and select the associated log for a device. The log will include the script output and response code.
Custom Attributes
The Scripts feature supports the use of custom attributes. To allow custom attributes to be processed within a script, check the box labeled "Enable custom attributes" in the script settings.