Create and execute scripts across multiple devices
Scripts allow technicians to run commands on one or many devices at once. There are two types of scripts, a saved script, or a one-time script. Saved scripts are listed under the Scripts section and under the Scripts tab. One-time scripts are not saved in this list, though they can be viewed in the job where it was run.
Video Walkthrough
Managing Scripts
Scripts allow technicians to run commands on one or many devices at once. Saved scripts are now located under the Automations tab, where you can group and organize them as needed. You can create custom groups for your scripts based on their function, platform (e.g., Windows, macOS, Linux), or any other categorization that fits your workflow. This update makes it easier to manage large collections of scripts.
Scripts can now be grouped for better organization. When creating or editing a script, you can assign it to an existing group or create a new custom group. This allows you to organize scripts in a way that suits your needs, making it easier to locate and manage scripts across multiple platforms and devices.
Script Groups:
Custom Grouping: You have the flexibility to create your own groups and organize scripts according to your team's needs—whether by platform, task type, or any other criteria that make sense for your environment.
Group Management: From the Automations tab, you can view, edit, and delete script groups to ensure that your library remains organized and up-to-date.
Creating a script
Create a script by clicking Create Script on the script page. Or edit a script by selecting its name.
Create or edit a script using the script editor
Name: The name of the script.
Description: A description of the script.
Language: The language the script was written in.
PowerShell
Bash
Zsh
Osquery
Python
Ansible
Go
Timeout - How long to allow the script to run before exiting.
Run as - Configure who the script is ran under, either System (Admin/Root) or as the Current User.
Script Editor - The editor where you can write or paste your script.
Running scripts
There are several places where a script can be initiated.
From the Device Listing, select the target devices, and then choose Actions -> Run script.
From Device Details, on the top right choose Actions -> Run script from the dropdown.
From an Automation, you can select the Run Script or Shell automation actions. This method allows you to run scripts across devices even if they are offline, as Automations will queue the execution until the device is next online.
On a Monitor Policy, a monitor can run a script if the monitored threshold is exceeded.
Once the script is selected then clicking Review Job will create a new job and place it in a Pending state where it awaits execution. The job will not run until a technician clicks the Execute Script button. In this state, the script can be edited, and from the device list, additional target devices can be added to the job by selecting them and choosing Scripts -> Add to Pending Job.
View a script's status on all of the devices selected for it to run
Once the job is executed, the script output for each target device can be shown by clicking the arrows at the far right. The top arrow will expand/collapse all devices. The Rerun option allows for rerunning the script on all devices, or on failed devices (in the event that a script failed to run on one or more devices).
Expand script outputs and rerun as needed
Jobs
To view all jobs choose the Jobs tab under the Scripts navigation menu item. At the top is a section called Script Queue which shows scripts in the pending state. All other executed jobs will be shown below in the Job History section. Completed job records cannot be deleted.
View your script queue and job history
Devices with different operating systems can be added to the same job. Level will not attempt check for validity of scripts against their OS or available scripting engines. If Powershell is attempted to run on Linux or Mac, and Powershell has not been installed, the the script will simply timeout.