Skip to main content
Question

Run a policy only when another policy has run?

  • September 17, 2012
  • 8 replies
  • 60 views

Forum|alt.badge.img+3

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

Forum|alt.badge.img+24
  • Valued Contributor
  • September 17, 2012

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.


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • September 17, 2012

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
Forum|alt.badge.img+19
  • Contributor
  • September 17, 2012

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.


Forum|alt.badge.img+24
  • Valued Contributor
  • September 17, 2012

Edit: nevermind.


Chris_Hafner
Forum|alt.badge.img+27
  • Jamf Heroes
  • September 18, 2012

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.


Forum|alt.badge.img+16
  • Honored Contributor
  • September 2, 2016

@Chris_Hafner

Thanks just used your suggestion : )

C


Forum|alt.badge.img+7
  • Valued Contributor
  • September 5, 2016

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

on the policy - under trigger Custom and specify the name


Forum|alt.badge.img+16
  • Honored Contributor
  • September 6, 2016

@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