4 hours ago
Help!
I have been trying to endlessly to get this to work...what am I doing wrong? I know for a fact that the logged in user has the workplace join key in their keychain but for some reason, when trying to run this for an EA it doesn't report correctly. I know the jamf runs with elevated privileges, but should it be able to run this without prompt for user credentials (like root), or is this not going to be possible?
#!/bin/zsh
currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ { print $3 }' )
uid=$(id -u "$currentUser")
haswpjkey="No"
wpjkey=$(launchctl asuser "$uid" sudo -iu "$currentUser" security dump-keychain | grep "Workplace Join Key" | xargs)
[[ "${wpjkey}" == *"Microsoft Workplace Join Key"* ]] && haswpjkey="Yes"
echo "<result>$haswpjkey</result>"
Solved! Go to Solution.
3 hours ago
You'll want the EA from https://github.com/benwhitis/Jamf_Conditional_Access/blob/main/EA_registrationStatus
Also, check the discussion from https://community.jamf.com/t5/tech-thoughts/macos-conditional-access-best-practices/ba-p/273760
3 hours ago
You'll want the EA from https://github.com/benwhitis/Jamf_Conditional_Access/blob/main/EA_registrationStatus
Also, check the discussion from https://community.jamf.com/t5/tech-thoughts/macos-conditional-access-best-practices/ba-p/273760