user_account_type_via_command_line

steve_bills
New Contributor II

Hello,

Is there a command line tool that will help me search for users accounts with either "Network/Managed" or "Mobile/Managed." Example: user_a mobile/managed, ect. ect.

Thanks in advance!

2 REPLIES 2

joshuasee
Contributor III

Hopefully, others will have better ideas, but there is no dedicated tool I know of. For mobile acounts dscl may be of some use:

dscl . -read /Users/$USER AuthenticationAuthority | grep LocalCachedUser

It will find nothing for a network user that isn't cached, so looping through local home directories and checking for a local directory record for each might help. If you're looking for non-mobile logins with no local home directory, try the "last" command, keeping an eye out for non-local users.

Also note that if you're using Active Directory, the UIDs, (visible with id -u) are much larger for AD accounts than native OS X accounts. Simply sorting accounts by UID is often enough to figure out which is which.

steve_bills
New Contributor II

Thank you very much!