EA to find mobile user account

Kevmo
New Contributor II

I'm trying to find a functional EA under Sonoma that I can use to create a search for users who still have mobile accounts.   Does anyone have one that works for builds later than 14.3?   I'm unsure what may have changed against other EAs I've found here.

2 REPLIES 2

AJPinto
Honored Contributor III

It should not be too hard, you just use dscl to search users UniqueID's and the obnoxiously high ID's are mobile accounts.

A_Collins
Contributor
#!/bin/sh

NETACCLIST=$(dscl . list /Users OriginalNodeName | awk '{print $1}' 2>/dev/null)
​
if [ "$NETACCLIST" == "" ]; then
        echo "<result>No Network Accounts</result>"
else
        echo "<result>$NETACCLIST</result>"
fi
exit 0