Posted on 09-15-2022 02:07 AM
I have a LAPS solution running monthly to reset the local admin password but I also want to be able to trigger this after the password has been viewed.
I have a custom trigger but without flushing the logs the custom trigger only runs monthly as well.
Has anyone figured out a way to have a policy running on schedule but also be able to trigger it from a custom trigger on demand? The only way I see to do this is to create another policy which isn't best to duplicate things just for this.
Posted on 09-15-2022 05:16 AM
@perryd84 Instead of a policy triggered via recurring check-in with a once every month frequency you could set it to just a custom trigger and use a LaunchDaemon running on your Macs to trigger that policy once a month by calling
/usr/local/bin/jamf policy -event YOURCUSTOMTRIGGER
Posted on 09-15-2022 05:21 AM
Hmmm thats a pretty good idea actually!! Thanks for this, let me test it out see if the functionality does what I want.
Posted on 09-15-2022 05:47 AM
In case you haven't seen it before here's a handy tool for creating the LaunchDaemon: https://launched.zerowidth.com/
09-21-2022 07:22 AM - edited 09-21-2022 07:23 AM
You don't even need a launch daemon, you could use use two policies:
Policy 1 Does what you wanted to do in the first place, with a Custom event "Policy 1" checked and "Ongoing" and a filled-out Self Service tab.
Policy 0 Runs Files and Processes, Execute command above for custom trigger "Policy 1", and triggers on Recurring checkin with a Execution frequency of Once every month.
Policy 1 can be run at any time, but policy 0 will also trigger Policy 1 once per month, at recurring check-in.
...which is just what pete already said. Sorry! :)
Posted on 09-15-2022 08:52 AM
You could also create 'nested' policies: the policy that actually Does Stuff, set to Ongoing with a custom event (trigger), then another policy set to once per month at check-in that calls the original's event.