I need an extension attribute to check if the logged in user (or any user) on a given machine is an AD user. We are trying to weed out users who are not authenticating against AD. We are using mobile accounts. Here is what I have at this point:
#!/bin/sh
result=$(ls -al /Users/ | grep Domain | awk '{print $4}')
if [ "$result" == "MYDOMAINDomain" ]; then
result="AD User"
else
result="Local User"
fi
echo "<result>$result</result>"
exit 0
However, I see there are some users who slipped through who have authenticated, probably because they are logged in as local users but have authenticated to AD in the past (?).
I could also test against users who are over 600 users by running:
dscl . -list /Users UniqueID
and filtering out users under 600, but am unclear on how to do that filtering.
In any scenario, there is probably a more graceful way of doing this, and am wondering if anyone has any suggestions?
Thanks.