Giter VIP home page Giter VIP logo

jamf-pro-policy-editor-lite's Introduction

Jamf Pro Policy Editor Lite

Make quick work of routine policy version updates with Jamf Pro Policy Editor Lite, which leverages the Jamf Pro API to automate routine policy version updates via an interactive Bash script


About

Since Jamf Pro PI-005903, I’ve been thinking of a faster way to update policies.

Last week, Adobe released six updates which — outside of building new packages via Adobe's admin console — effectively required only incrementing a version number four places in each policy (please don't tell @talkingmoose):

  • Adobe After Effects CC 15.1.1 was update to: Adobe After Effects CC 15.1.2
  • Adobe Media Encoder CC 12.1.1 was update to: Adobe Media Encoder CC 12.1.2
  • Adobe Bridge CC 8.0.1 was update to: Adobe Bridge CC 8.1
  • Adobe Premiere Pro CC 12.1.1 was update to: Adobe Premiere Pro CC 12.1.2
  • Adobe Prelude CC 7.1 was update to: Adobe Prelude CC 7.1.1
  • Adobe XD CC 9.1.12 was updated to: Adobe XD CC 10.0.12

With inspiration from @mm2270's API scripts, Jamf Pro Policy Editor Lite was born.


Requirements

API

To utilize this script, the API account must have the following privileges:

  • Computers: READ
  • Packages: READ
  • Policies: CREATE, READ, UPDATE
  • Because of the need to use API credentials with Create privileges, the script allows you to interactively enter the credentials so they don't need to be stored within the script. (Thanks, mm2270)
  • The script performs only minor error checking; please ensure proper API credentials or you will encounter errors

Policies

If policies include the version number in parenthesis, for example: "Adobe Prelude CC 2018 (7.1.1)", the script will automatically parse the version number, for example: "7.1.1"; otherwise, you will be prompted for the version number.

(If your policy names preceded the version number with a dash, search the script for the currentVersion variable to change the default behavior.)

Packages

The updated package must be present before running this script.


Usage

This script was designed to be run interactively in Terminal and allows you to use the API (along with valid API credentials) to update a policy's version number.

This script uses some BASH specific items; please first make the script executable:
chmod +x /path/to/policy-editor-lite.bash

To use the script: /path/to/path/to/policy-editor-lite.bash

Version 1.4.4

Inspired by @grahampugh's erase-install, Jamf Pro Policy Editor Lite, version 1.4.4, now includes the following flags:

bash ./policy-editor-lite.bash --help

Jamf Pro Policy Editor Lite, 1.4.4
by Dan K. Snelson (@dan-snelson)

    Usage:
    bash ./policy-editor-lite.bash [--filter] [--auto] [--version] [--debug]

    [no flags]    Displays all polcies
                  If API variables are left blank, you will be prompted to interactively enter.
                  If you have multiple lanes, fill-in variables in the "laneSelection" function.

    --filter ...  Filters policy names

    --auto        Auto-answers "yes" to prompt Nos. 2, 5 and 6

    --version     Specifies the new version number

    --debug       Enables debug mode

    --help        Displays this message and exits

For example, the following command will filter policies names containing foundry, auto-answer Y to prompt numbers 2, 5 and 6, and pre-populate 7.2.0 for the version number for prompt number 4.

bash ./policy-editor-lite.bash --filter foundry --auto --version 7.2.0

Warning

While the script does backup a policy's XML before performing updates, please thoroughly test before using in production.


Special Thanks


Presentations

jamf-pro-policy-editor-lite's People

Contributors

dan-snelson avatar dev-yeet avatar

Stargazers

Shyam Sundar avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.