Trigger Actions via the Command Line

Ben Greiner -

Trigger Actions via the Command Line

In addition to Self Service options, Actions can be remotely executed on a workstation through an SSH connection or by using the Apple Remote Desktop UNIX command. You can find a full list of our command line triggers on our web site here.

SSH (Secure Shell Protocol)

  1. Navigate to your Applications > Utilities folder and open the Terminal application.
  2. Gather the username and password for the target workstation, as well as the IP address or DNS name.
  3. Type the following into Terminal and press Return (replacing username and ipaddress/DNS with the info from step 2): ssh username@ipaddress
  4. Enter the password associated with the username and press Return. Type yes to acknowledge the RSA fingerprint (if prompted).
  5. To manually run an Inventory Report, type the command: sudo jamf recon
  6. To trigger an Action, type the following (replacing actiontrigger with the specific Action's trigger from this page): sudo jamf policy -event actiontrigger

The Action will begin to execute behind the scenes. If an Action is chosen that includes a software installation or patch of some kind, then the end-user may see a disk image mount briefly on the Desktop. The disk image will only show up if the end user has "CDs, DVDs and iPods" checked in Finder > Preferences > General (this is unchecked by default). 

Apple Remote Desktop

  1. Open Remote Desktop.
  2. Select the workstation(s) where you want to trigger an Action.
  3. Click on the UNIX button (or Menu > Manage > Send Unix Command…). A window will appear (see screenshot below).
  4. Type this command into the top white box (replace actiontrigger with the Command Line Trigger you would like to run): /usr/local/jamf/bin/jamf policy -event actiontrigger
  5. Click on the User radial button (under Run command as) and enter: root
  6. Click Send.

The Action will begin to execute behind the scenes. The end-user may see a disk image mount briefly depending on their preferences.

fa02be79-288d-4728-b44e-f3ebc27082e5_display.png

 

 

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.