Skip to main content
Question

Running policy to check for policies assigned to user ID

  • Jul 29, 2024 3:01 PM UTC
  • 1 reply
  • 70 views

easyedc
Forum|alt.badge.img+16

A few years ago I was able to get my fleet transitioned from AD accounts to local accounts with managed passwords via Enterprise Connect and then kerberos SSO. Since we're no longer binding I've created a workaround to leverage ad groups to apply policies. My policy reads the Kerberos SSO signed in credential, strips that to just their User ID, and then runs a

/usr/local/bin/jamf policy -username $founduser

The policy is great when run via self service, however it fails running on an automated trigger. My first chat with Jamf Support tried to tell me that i was reading the username incorrectly which is why it fails, however I think it's due to the fact it's a policy calling another policy. I get a

Script result: Local User Profile name is USERID Checking for User Specific Policies This policy trigger is already being run: root 4028 0.0 0.1 411796288 33456 ?? S 8:20AM 0:00.23 /usr/local/jamf/bin/jamf policy -event CLIENT_CHECKIN -stopConsoleLogs

Does anyone do anything like this? Have any suggested work arounds? I was debating writing a launchagent pointing to my script saved in a random directory and let it run once a day.

1 reply

WickedSmaht
Forum|alt.badge.img+5
  • Contributor
  • Dec 2, 2026 9:29 AM UTC

The error message suggests that your username detection isn't the problem. You're effectively invoking another jamf policy process while the recurring check-in is still running.

I'd separate the user-specific policy execution from the recurring check-in entirely.

A root-owned LaunchDaemon running on a scheduled interval could:

  • Identify the currently logged-in user.

  • Retrieve and validate their Kerberos identity.

  • Check whether another Jamf policy process is running and defer execution if necessary.

  • Invoke a dedicated custom trigger:

/usr/local/bin/jamf policy -event user-specific -username "$founduser"

I'd use a LaunchDaemon rather than a LaunchAgent here, since the Jamf binary needs elevated privileges to execute management policies reliably.

Make sure the policies associated with the custom trigger don't invoke the same script again, otherwise you could introduce a recursive execution loop.

This would preserve your existing AD group-based scoping without interfering with the standard recurring check-in workflow or requiring the Macs to be domain-bound.