Using a Launch Agent to Trigger a Custom Event

theninjatech
New Contributor

Hi everyone. I'm trying to deploy a launch agent to several machines to have them run a particular policy that has to be run for each user who logs on in order for that user to use an application. I have a policy with a script that creates the launch agent and puts it in /Library/LaunchAgent and the launch agent runs when the users log in to the macs. But it doesn't run the policy because it's not being run as root. Is there a way to successfully trigger a policy update using a launch agent?

I'm not using the Login trigger because it's deprecated and we can't wait for the recurring check-in for every user that logs on before they can use the application.

3 REPLIES 3

tlarkin
Honored Contributor

Pretty sure this might be a use case for Outset

a_stonham
Contributor II

Could you not just the login trigger in your policy? If there are certain conditions that need to be met to run the policy do the validation in your script.

Or you can have a login trigger and run your script rather than having it be deployed to the mac.

theninjatech
New Contributor

I've selected the login trigger on the policy with the hopes that it will work most of the time but I know that's being deprecated and I've been told it's not always reliable. It seems to be working on my test system so maybe it will work for the production machines. I'd really like to find a surefire way of calling a Jamf policy update from a launch agent though. I suppose I could always add a hidden administrator account to the systems and script it to sudo with those credentials but something about that approach doesn't feel right.

Outset looks interesting. Thanks for suggesting it. I'll have to do some reading on that.