I find myself taking a lot from jamfnation and not giving much back in return, so here is my simple little extension attribute for showing all non-default administrator accounts from Macs in your estate. You will need to change the underscored section for your environment. I use this with Smart Groups to generate emails after a recon has detected this attribute has a value.
Date Type: String
Input Type: Populated by Script
Script Contents:
groupmember=`dscl /Local/Default read /Groups/admin GroupMembership | tr ' ' '
' | grep -Ev 'root|change_for_your_default_admins_separated_by_pipes|GroupMembership:|admin' | tr '
' ' '`
echo "<result>$groupmember</result>"
It basically reads the membership of the local administrator group and removes values (your default admins + additional info) from the output, leaving you non-default members of the local admin group.
If you work in an environment that has compliancy audits then this is really useful for checking all local administrators are justified.
