Managing Scripts

The way you manage scripts depends on the way scripts are stored in your environment. There are two ways scripts can be stored:

  • As data in the jamfsoftware database—Before you can run a script in this type of environment, the script must exist in the database. There are two ways to achieve this:

    • Add the script to Jamf Admin

    • Add the script to Jamf Pro using the script editor

  • As files on your distribution point(s)—Before you can run a script in this type of environment, the script must exist on the distribution point you plan to deploy it from and in Jamf Pro. You can add the script to the master distribution point by adding it to Jamf Admin. Then you can add the script to other distribution points via replication.

Note: For more information on migrating the scripts on your master distribution point, see the following Knowledge Base article:
Migrating Packages and Scripts

Each of these methods also involves configuring settings for the script. When you configure settings for a script, you can do the following:

  • Add the script to a category. (For more information, see Categories.)

  • Choose a priority for running the script during imaging.

  • Enter parameter labels.

  • Specify operating system requirements for running the script.

When you add, edit, or delete a script in Jamf Admin, the changes are reflected in Jamf Pro and vice versa.

Requirements

To add a script to Jamf Admin, the script file must be non-compiled and in one of the following formats:

  • Perl (.pl)

  • Bash (.sh)

  • Shell (.sh)

  • Non-compiled AppleScript (.applescript)

  • C Shell (.csh)

  • Zsh (.zsh)

  • Korn Shell (.ksh)

  • Tool Command Language (.tcl)

  • Hypertext Preprocessor (.php)

  • Ruby (.rb)

  • Python (.py)

Adding a Script to Jamf Admin

Adding a script to Jamf Admin adds the script to the jamfsoftware database or the master distribution point, and to Jamf Pro.

  1. Open Jamf Admin and authenticate to the Jamf Pro server.

  2. Drag the script to the main repository in Jamf Admin.
    The script is displayed in blue text in the Unknown category until you add it to a category.

  3. Double-click the script in the main repository.

  4. Click the General tab and configure basic settings for the script, including the display name and category.
    images/download/attachments/16441862/Script_General.png

  5. Click the Options tab and configure additional settings for the script, including the priority and parameter labels.

    images/download/attachments/16441862/Script_Options.png
  6. Click OK.

Adding a Script to Jamf Pro

If your environment is one in which scripts are stored in the jamfsoftware database, you can add a script to Jamf Pro using the script editor.

  1. Log in to Jamf Pro.

  2. In the top-right corner of the page, click Settings images/download/thumbnails/16441862/Icon_Settings_Hover.png .

  3. Click Computer Management.

  4. In the “Computer Management” section, click Scripts images/download/thumbnails/16441862/Scripts.png .

  5. Click New images/download/thumbnails/16441862/Icon_New_Button.png .

  6. Use the General pane to configure basic settings for the script, including the display name and category.
    Note: If you do not add the script to a category, Jamf Admin displays the script in blue text in the Unknown category.

  7. Click the Script tab and enter the script contents in the script editor.

  8. Click the Options tab and configure additional settings for the script, including the priority.

  9. (Optional) Click the Limitations tab and configure operating system requirements for the script.

  10. Click Save.

Editing or Deleting a Script Using Jamf Admin

  1. Open Jamf Admin and authenticate to the Jamf Pro server.

  2. In the main repository, select the script you want to edit or delete.

  3. Do one of the following:

    • To edit the script, double-click it and make changes as needed. Then click OK.

    • To delete the script, click Delete images/download/thumbnails/16441862/icon_CA_delete.png and then click Delete again to confirm.

If the script is stored in the jamfsoftware database, the edit or delete action is applied immediately.

If the script is stored on your distribution point(s), the edit or delete action is applied immediately on the master distribution point. The action is applied to your other distribution points when replication occurs.

Related Information

For related information, see the following section in this guide:

Running Scripts
Find out how to run scripts using a policy or Jamf Remote.

Copyright | Privacy | Terms of Use | Security
© copyright 2002-2017 Jamf. All rights reserved.