Run jamf policy command at log on with launchd

vinicio
New Contributor

Hello all, I just wanted to know if i could get some help to make the below code to work. Basically i want to run the "jamf policy" command at log on. Is there something that i am missing??

Thank you.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict> <key>Label</key> <string>com.runPolicyAtLoad</string> <key>ProgramArguments</key> <array> <string>/bin/sh</string> <string>-c</string> <string>sudo /usr/local/jamf/bin/jamf policy </string> </array> <key>RunAtLoad</key> <true/> <key>UserName</key> <string>root</string>
</dict>
</plist>

1 REPLY 1

bvrooman
Valued Contributor

Do you have login/logout hooks enabled under the Computer Management -> Check-In settings? That seems to be a simpler way to accomplish a checkin upon login.

If you want an actual recurring checkin to happen at login, you could create a policy with the login trigger that runs "jamf policy" - you'll get more control enabling login hooks and using the separate login trigger on individual policies, though.