Skip to main content
Question

user_account_type_via_command_line

  • February 14, 2018
  • 2 replies
  • 6 views

Forum|alt.badge.img+5

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

Forum|alt.badge.img+17
  • Valued Contributor
  • February 14, 2018

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.


Forum|alt.badge.img+5
  • Author
  • New Contributor
  • February 14, 2018

Thank you very much!