Policies are typically run by the jamf binary on managed computers according to the triggers and execution frequencies configured in Jamf Pro. However, there may be certain situations in which you want to run a policy manually, such as when troubleshooting a problem, or any other scenario that requires an exception to the rules you have configured in Jamf Pro.
You can use the jamf binary to manually run policies on a target computer in two ways:
By specifying a policy ID number, which will run a specific policy scoped to the target computer
By specifying a trigger, which will run all policies scoped to the target computer configured with that trigger
To run policies manually, you must have either physical access to the target computer or remote access via SSH.
To manually trigger a specific policy using the jamf binary, execute the following command on the target computer:
sudo jamf policy -id 15Replace "15" in the above example with the Jamf Pro ID number of the specific policy you want to trigger.
You can find the Jamf Pro ID number of a policy by navigating to it in Jamf Pro and checking the URL in your browser's address bar. For example, if the URL of the policy is https://mycompany.jamfcloud.com/policies.html?id=133&o=r, the Jamf Pro ID is 133.
Optionally, you can also append the -verbose flag to the above command for additional details in troubleshooting scenarios. Keep in mind that this command will fail if the computer is not in scope of the specified policy.
To run all policies scoped to a managed computer that are configured with a given trigger (e.g., run all policies scoped to the target computer with a Login trigger), execute the following command on the computer:
sudo jamf policy -event login Replace login with the appropriate trigger. The following is a list of pre-defined triggers:
Startup—
startupLogin—
loginLogout—
logoutNetwork State Change—
networkStateChangeEnrollment Complete—
enrollmentCompleteRecurring Check-in—None (execute
sudo jamf policy)
If the policy has a custom trigger, replace login in the above command with the custom trigger name specified in the policy. A policy with a custom trigger must be run manually using the jamf binary.
Jamf Pro runs the specified policy or policies on the target computer.