Run a policy only when another policy has run?

lifelike
New Contributor

Maybe I'm not looking in the right place but is there a way to run a policy upon successful completion of another policy?

I tried to create a smart group that would be populated only with machines that had run a particular policy. But could not. Do I need to create an extension attribute for this?

8 REPLIES 8

jarednichols
Honored Contributor

You could have a script execute at the end of your policy that checks for some kind of successful condition and then manually calls the follow-on policy.

lifelike
New Contributor

Yeah I thought of that, but it's too late. Will just have to wait until all the machines have run the policy. thanks for your reply.

dpertschi
Valued Contributor

Not sure how you'll gauge 'successful' on the first policy, but you only need to add a custom trigger to call the second policy.

jarednichols
Honored Contributor

Edit: nevermind.

Chris_Hafner
Valued Contributor II

I know this doesn't matter too much to you now but...

There was another post some months ago that suggested creating a fake receipt that the JSS can look for and base a new policy on. We've been using it for some time since successfully. You can either script it or add the following to the "Run Command" line in the "Advanced" tab of your policy

touch /Library/Application Support/JAMF/Receipts/'name of receipt'.pkg

You can then setup a smart group based on the existence thereof.

gachowski
Valued Contributor II

@Chris_Hafner

Thanks just used your suggestion : )

C

khey
Contributor

you can use a script that contains sudo jamf policy -trigger custom_event

on the policy - under trigger Custom and specify the name

gachowski
Valued Contributor II

@khey

Yep that would too : ) I went with dummy.pkg so that machine would move to a smart group. I would guess that there are pluses and minuses to both approaches ...

Thanks for helping out!

C