create a smart group based on User Account Type?

walt
Contributor III

I'm trying to determine which computers have a Mobile LDAP account that are Jamf enrolled. For example in a Computer's inventory record under Local User Accounts it has the UID, Account Type, Admin Yes/No.

Is there any way to pull the Type: Mobile LDAP into a smart group or some sort of reporting?

1 REPLY 1

dan-snelson
Valued Contributor II

@walt The following Extension Attribute code may prove helpful:

#!/bin/sh

loggedInUser=$(stat -f%Su /dev/console)

if [[ $( /usr/bin/dscl . read /Users/${loggedInUser} OriginalAuthenticationAuthority 2>/dev/null) ]]; then
    echo "<result>$loggedInUser is an Active Directory Mobile account</result>"
else
    echo "<result>$loggedInUser is a Local Directory account</result>"
fi

exit 0