Is there a command i can run from terminal that will show what type of accounts are used
something that reports the username and type of account like below
/Users/fred - mobile, standard
/Users/wilma - network admin
Try this command. It should display what you want.
/usr/bin/dscl . -read /Users/username |
egrep 'NFSHomeDirectory|RecordType' | tr '\n' ':' | cut -d':' -f2,5
/Users/username:Users
id
?
Start with:
users
then:
id -Gn XXusernameXX | grep 'admin'
If you have an output, then 'XXusernameXX' is an admin account
id -Gn XXusernameXX | tr ' ' '\n' | grep -e '^admin'
There's a simple command/utility called dsmemberutil
that will check the group membership of a user. Below is an example of command usage and the output of a user is a member of the group in question (admin)
dsmemberutil checkmembership -U username -G admin
user is a member of the group. <------------------ Output result
It will also return an exit value of 0 if successful or a 1 if not meaning you can use it within if/then
or [[ ]]
evaluations in Bash/Zsh.