Reply To: Find standard or admin user on mac

#14255
AvatarEthan Miller
Moderator
1 pt

Hi @timo-liam,
Thank you for reaching out to us.
You can fetch the list of admin users with custom scripts for macOS devices through Hexnode. To do so, navigate to Execute Custom Script under Actions in the device details page and upload a shell script file with the command below:

dscl . -read /Groups/admin GroupMembership

You can also check whether a particular user is an admin or not using the command:

if groups username | grep -q -w admin;
then
echo "Is admin";
else
echo "Not admin";
fi

You can view the output of the commands by clicking on Show Output under Status in the Action History tab of the device details page.

Output

Alternatively, you can enable Live Terminal on your devices to run these commands from Hexnode. You’ll be able to see the results in real-time without using custom scripts.

Hope this answer helps you.

Cheers!
Ethan Miller
Hexnode UEM