So Jamf connect 2.0 has changed a bit on the author. Does anyone have any extension attribute made for which login window is used on a client - native login og JCL window.
Know the stuff happens in the auth.db database, but struggling to find a way to create an extension attribute to verify which login mechanism the clients have
You can build something that reads out
security authorizationdb read system.login.console
The Mechanisms key lists the loginwindow settings as an array of strings. Mechanisms defined as "privileged" prompt the loginwindow to run the mechanism as the root user. The only built-in macOS mechanism removed by Jamf Connect is loginwindow:login, which displays the standard macOS login window.
@jameson A simple grep against the output should be enough. If all you need to know for the Extension Attribute is whether the
loginwindow:login string is present, then just grep for it, and if found, set a variable to
Yes or some other simple string and echo back. Or, if not present, echo back
For example, something like the following should work I think.
#!/bin/sh loginwindow_check=$(security authorizationdb read system.login.console | grep 'loginwindow:login' 2>&1 > /dev/null; echo $?) if [ $loginwindow_check == 0 ]; then echo "<result>OS LoginWindow</result>" else echo "<result>JC LoginWindow</result>" fi