manually running periodic policies

AVmcclint
Honored Contributor

Is there a way to manually trigger policies set to run at a specific execution frequency? Something like

jamf policy -event monthly

Why would I want to do this? I have spare Macs on a shelf that I plug in and power up from time to time to make sure they get updates and check in while they aren't assigned to anyone. I don't always get to them on a regular basis so when I do get to them, I'd like to make sure all the monthly tasks are also run even if it hasn't been a full month since the last time.

2 REPLIES 2

AVmcclint
Honored Contributor

On a related note: Would it be advisable to create policies that run the OSX

periodic daily
periodic weekly
periodic monthly

commands since the users only put their computers to sleep and these commands are never run when they should?

dwandro92
Contributor III

If the policies are using the check-in trigger, this might do the trick:

jamf recon              # Update inventory.
jamf flushPolicyHistory # Flush logs so monthly policies can be run again.
killall jamf policy     # Stop running "jamf policy" executions, as manually triggering will fail otherwise.
jamf policy             # Execute recurring check-in policies.

I don't use any monthly policies in my environment, so this solution is untested. Please let me know if it works.

If the above solution does not work, another option would be to duplicate your monthly policies and set them to run on an ongoing frequency using the custom trigger "monthly".