Quantcast
Channel: rtrouton – Der Flounder
Viewing all articles
Browse latest Browse all 764

Running multiple Jamf Pro policies via custom trigger

$
0
0

As a follow-up to my previous post about running multiple Jamf Pro policies via the API, my colleague John Kitzmiller pointed out that it was possible to achieve similar functionality by using a custom trigger. For more details, see below the jump.

A Jamf Pro policy can be called using a keyword by setting a custom trigger.

Screen Shot 2017 04 08 at 11 45 57 AM

This keyword can then be run using the following command:

jamf policy -event trigger_keyword_goes_here

You can also use the custom trigger synonym of trigger instead of event in the command.

jamf policy -trigger trigger_keyword_goes_here

To set the order for the policies called by the custom trigger, I need to use numbering as part of the policy name. The first policy name starts with 010, the second policy with 020 and so on.

Screen Shot 2017 04 08 at 11 44 36 AM

 

Once the policies are in place, a script like the one shown below can be used to run the policies in their specified order by calling the custom trigger’s keyword.

The script is also available on Github at the following address:

https://github.com/rtrouton/rtrouton_scripts/tree/master/rtrouton_scripts/Casper_Scripts/manual_trigger

If you want to run this script from your Jamf Pro server, it should be set up as follows.

Screen Shot 2017 04 08 at 12 08 04 PM

 

Screen Shot 2017 04 08 at 12 08 02 PM

 

 

Screen Shot 2017 04 08 at 12 07 58 PM

To use this capability, you will need to set the custom trigger with each of the policies you want to run and then set the script to use that custom trigger. The script will send the custom trigger to the Jamf Pro server, which will then run all policies associated with the custom trigger keyword in the specified order.



Viewing all articles
Browse latest Browse all 764

Trending Articles