Run a Script
Run a Script runs an approved script from the Script Library on the selected computers. It runs approved scripts only. The computer receives the code exactly as it was approved. The agent checks the approval itself before it runs anything.
Menu path
Endpoints > Endpoint List > select the computers > Change > Software and Files > Run a Script.
The same action is on Endpoints > Endpoints Dashboard > Setup > Scripts. See The Script Library.

The dialog
| Field | What it does | Default |
|---|---|---|
| Computers | The computers the script runs on | The selected rows |
| Script | A script from the Script Library. The list shows approved scripts, then scripts under a live emergency approval. | The first script in the list |
An empty Script list means no script is approved yet. A note under the list says how to add one: write it with New Script on Endpoints > Endpoints Dashboard > Setup > Scripts. It appears once your approvers have given every approval your rule needs. That needs at least two approvers. See Approvers and the Keyring.
The dialog has no field for code or values. Nothing typed here can change what runs.
Run sequence
- The server reads the script's name, language and code from the Script Library.
- The server refuses the run if the script has no live approval. The message gives the reason.
- The script is sent to each computer with its seal: the signed approvals.
- The agent checks the seal against the code it received. A changed character, a missing signature or an expired approval is refused on the computer.
- The agent runs the code. The script has 300 seconds to finish.
The run is named "Script:" followed by the script name. A run under an emergency approval is labeled BREAK-GLASS in Activity.
Values in a script
A script can be handed values without changing its code. Each value is passed to the script as an environment variable named XA_ plus the value's name. A PowerShell script reads a value called Path as $env:XA_Path. A command-prompt script reads it as %XA_Path%.
A value pasted into the code changes the code. The approval no longer matches it, so the run is refused. See Writing a script.
Approvals
- A script needs the approvals set in the keyring. By default that is two company approvers and xAssets.
- An approval lasts 3 days. Any edit to the script clears it.
- Emergency Approval lets one approver run a script for 4 hours, when the keyring allows it.
See Approving a script and Emergency Approval.
After you click OK
The message reads "The script was sent to the selected computers". The phases are Sent and Succeeded. Find the run in Endpoints > Endpoints Dashboard > Activity > Jobs. See Jobs.
Undo
A script cannot be undone. A script can do anything, so xAssets cannot know how to take it back. To reverse a script's work, write and approve a second script that does the reverse.
Key points
- Run a Script is the approved route for any custom command on a computer.
- Connect > Run Command runs a typed command line with no approval. See Run Command.
- An agent older than the seal release ignores seals and runs the code as sent. The server still refuses unapproved scripts at dispatch.