Zoomed Image

The Script Library

Endpoint Management Guide

Script Library

The Script Library

Only approved scripts run on your computers. The Script Library lists the scripts your organization writes, and records who approved each one. Open it from Endpoints > Endpoints Dashboard > Setup > Scripts.

The Scripts tab with the script action buttons above the Script Library list, and Become an Approver below it

Approval process

Every piece of code an action sends to a computer is approved before it runs. The approval is a set of digital signatures over the exact text of the code.

  • Product actions. The code inside xAssets actions, for example Ask the Fleet, is approved by xAssets when the product is built.
  • Your scripts. A script in the Script Library needs approvals from your own approvers only. xAssets staff approve nothing for you.

The check happens twice. The xAssets server refuses to send code that is not approved. The agent checks the signatures again on the computer itself. It refuses code that does not match them. A changed character changes the code, so the approval no longer applies.

Agents from version 7.3.6009 check the signatures. An older agent relies on the server check until it upgrades. See Security Model.

Roles

Role What they do Page
Author Writes the script and submits it Writing a Script
Company approver Reads the script and approves it from their own PC Approving a Script
xAssets Signs the scripts that ship with the product, when the product is built. Approves nothing else. Shipped Scripts

The author may also be one of the approvers. A team of two can approve its own scripts.

The approval rule

The approval rule sets how many company approvals a library script needs. It also sets whether emergency approval is allowed. The rule is part of the keyring: the signed list of your approvers. You change it with Change Approvers. See Approvers and the Keyring.

Setting Choices Default
Company Approvals (DMPCApproveLibraryCount) 1 to 5 2
Emergency approval allowed No, Yes No

A looser rule needs the number of current approvers you set in DMPCApproveGrantCount. See Approvers and the Keyring.

Approval duration

An approval lasts the number of days in the setting Days an approved script can run (ScriptApprovalWindowDays), from 1 to 30. A new database has 30. The window runs from the earliest signature. With 3 days, a script approved on Monday at 09:00 runs until Thursday at 09:00. After that it needs approving again.

Any edit to the script clears its approvals.

The menus

The Scripts tab has two lists. Each has its own column of action buttons above it.

List Actions
Script Library New Script, Edit Script, Approve, Run a Script, Emergency Approval. See Emergency Approval
Approvers Become an Approver, Change Approvers, Lock Approvers, Approver Recovery, Revoke Approver, Lock Down Endpoints, Lift Lockdown. See First Approver and Lock Approvers and If Your Approvers Leave

The Script Library list

Column What it shows
Script The name
Language powershell, cmd or vbscript
Status Draft, Pending, Approved or Expired
Company Approvals Approvals from your approvers in the last 30 days
Runnable Until When the current approval ends
Written By The author of the current text
Updated When the script was last saved
Status Meaning
Draft Saved and not yet submitted or approved. A saved edit returns a script to Draft.
Pending Submitted, or approved by some but not all of the approvers it needs
Approved Has every approval the rule needs, within the window. It can be run.
Expired Had its approvals, and the window has passed

Key points

  • The server refuses an unapproved run and gives the reason. For example: "This powershell script is not approved to run on endpoints (the approval has expired)".
  • Values reach a script as environment variables, never pasted into the code. A script reads a value called Name as $env:XA_Name.
  • Installs from the software library use the same approvals. See Software Library.