Question regarding policy execution via script......

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
01-10-2019
04:12 PM
- last edited on
03-04-2025
04:46 AM
by
kh-richa_mig
Hey all, when a script is used to execute policies.... example....
/blahblah/jamf policy -id ####
/blahblah/jamf policy -id ####
/blahblah/jamf policy -id ####
Does each policy finish 100% before it executes the next?
Also, I see people mentioning the ampersand (&) when referring to executing policies in scripts... how is that utilized please?
Thank you in advance!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 01-10-2019 05:14 PM
My understanding is that each policy has to finish before the next policy can run. As far as the & in a shell script or just in terminal you can string commands together using a double &&. For example I use the following often in terminal.
sudo jamf recon && sudo jamf policy && sudo jamf manage
Basically means:
Run the first command if it completes successfully run second command and if it completes successfully run third command.
You could also use a ; if you wanted the second and third command to run regardless of how the previous command finished.
