Posted on 06-04-2018 02:00 PM
I am testing a policy. I want to run the policy from a command line. I know the command is jamf policy -event XXX
But Im getting "No policies were found for the "XXX" trigger
I used this method in the past for testing. What could possible be the problem now?
Thanks in advance
Solved! Go to Solution.
Posted on 06-05-2018 08:10 AM
I had the incorrect syntax for what I was trying to do. I had:
Jamf policy -event XXXX
I should have had:
Jamf policy -id XXXX
Posted on 06-04-2018 02:09 PM
Scope? Execution Frequency? Either of those could be affecting things now. For example, the Mac you're testing on needs to be in scope for the policy to execute, whether manually added in to the scope or via a Smart/Static Group or such.
Second, make sure the policy isn't set to a 'Once per computer' frequency, as that would mean each time you run it, it needs to be flushed from the policy log in order for it to run again on that same machine. For testing, if you need to test repeatedly, set the execution frequency to Ongoing, but remember to set it back to whatever actual frequency you want the policy at once done with your testing.
Posted on 06-04-2018 02:17 PM
Thanks for the response @mm2270 I checked both those and my test machine is in the scope. I just changed the frequency to ongoing for testing. Still no luck. In fact when I attempt to run any policy from the command line it fails. This is some thing new
Posted on 06-04-2018 02:19 PM
Hmm. Did you happen to cancel the policy the last time it was run before it completed?
Posted on 06-04-2018 02:27 PM
No.
I even went into the Jamf/Reciepts just in case......
Just for snorts and giggles I cloned another policy, assigned to my test machine and set frequency to ongoing. Still not working. To be clear if I use Jamf Remote it works, however the checkin policy does not work
Posted on 06-04-2018 03:01 PM
Exclusion based on user? JAMF Remote would not need a user logged into the machine, but running it locally would and that user could be excluded.
Posted on 06-04-2018 05:49 PM
Using Terminal JAMF commands requires SUDO on an Admin account. Even is you SU into the account.
Posted on 06-05-2018 08:10 AM
I had the incorrect syntax for what I was trying to do. I had:
Jamf policy -event XXXX
I should have had:
Jamf policy -id XXXX
Posted on 06-05-2018 08:16 AM
You can use -event or -trigger for "Custom Event", or -id for Policy ID#.
Posted on 06-05-2018 08:47 AM
OK, well, that would explain it. I actually did wonder briefly if you were using the right flag, but I figured that was correct and it was something else going on. Glad you got that straightened out.