Support Center

Getting Started: Commands

You can run JumpCloud® commands to execute scripts on fleets of machines through JumpCloud's system agent. You can deploy files, schedule maintenance activity, or install software on endpoints in PowerShell, bash, shell, and more. Commands can run across one or more systems in parallel and retrieve command results (including stdout, stderr, and exit codes).

Commands let you quickly and easily automate tasks across multiple servers, launch those tasks based on a number of different types of events, and get full auditing of all command results.

Prerequisites

Before you configure commands to execute:


This KB covers:

 

Create a New Command

To add a new command:
  1. Log in to the JumpCloud Admin Portal: https://console.jumpcloud.com/login.
  2. Go to Commands.
  3. Click ( + ). The New Command panel appears.
  4. Specify the following Details for the new command:
  • Enter a Name for the command. Use this name to find the command in the Command list.
  • Select the operating system Type: Linux®, Windows® or Mac®.
  • Select the role or user you want to the run the command as (Run As):
    For Linux and Mac systems: 
    Select the role or user you want to run the command asS
    For Windows systems:
    Commands will run as the LocalSystem account role. Optionally, you can run the command as Windows Powershell.
  • Type or paste a script into the Command text box. The script can be in any language that your servers can execute.
  • Select the launch event. See Launch Event.
  • Optionally, modify the timeout value. In the Timeout After field, specify the amount of time (in seconds) after which the command should stop trying to execute. The default timeout value is 120 seconds.  
  • Optionally, click Upload File to upload a file to the system. See Files.
  • Click the System Groups tab to set the specific system groups on which this command will execute.
  • Click the Systems tab to set the specific systems on which this command will execute.
    Note: Be aware that commands only execute on compatible systems. For example, if you connect a Mac command to a Linux system, it won't run on the Linux system.
  • Optionally, click the Command Runners tab to elect a user as a Command Runner with access to run the command. By default, admins can run commands on all systems.
  1. Click save command.

Launch Event

You have a number of choices as to how a JumpCloud command is launched:
  • Run Manually - commands set to run manually can be executed from the Commands list. To run a command manually, click run now next to the command's name in the Commands list.
  • Run as Scheduled - commands set to run as scheduled execute one time on the day and time that you specify on the Schedule run for field. This setting is useful for one-time operations that need to run during a change window.
  • Run as Repeating - commands set to run as repeating execute on the interval you specify. Specify:
    • Command repeats by  - specify when the command should repeat - You can select that it repeat by a specific Minute / Hour / Day / Week / Month.
    • Repeat every N days - specify the number of days (N number of days) after which the command should repeat. 
    • Run at - specify the time at which the command should run. Enter the time in the 24-hour format: HH:MM, such as 13:30 (1:30 PM), or 03:30 (3:30 AM).
  • Run on Trigger (webhook) - commands set to run on trigger execute when a webhook is received from an external source. Specify the Trigger Name. Learn about command triggers.
Note: The execution time for scheduled and repeating launch events corresponds with the target system's time zone. In the JumpCloud Admin Portal, the event is labeled as Server Time.
 

Files

Upload one or more files to push to the server before the command executes. The file is pushed  immediately, before the command executes. As such, you can update the files anytime and know that the next time your command runs it will have the latest update.

There are no file type restrictions. However, 
there is a 1MB size limitation per file attachment and in the command results logging. 
 

Command Results 

After a command executes, the bottom section of the Commands panel gives the exit code as reported by the system. If multiple commands are processed at runtime, only the last exit code is reported. The stdout of the command is shown in the Log portion of the command result's details.


 

Looking for some example commands? 

Check out the JumpCloud Commands Gallery.

Find More Information

Find more information about commands in the JumpCloud Knowledge Base Commands section.
 

Last Updated: May 16, 2019 02:26PM MDT

Related Articles
desk-forwarding@jumpcloud.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete