# other Directory Service nodes than the default local node. # By using dseditgroup, the script could also be extended to handle # instead of "dsmemberutil checkmembership". # It could be rewritten to work on 10.4 by using "dseditgroup -o checkmember" # Expected to work on Mac OS 10.5 and newer, tested on 10.6 and 10.7. This members script is equivalent to the shell function, but has nicer handling of invalid input: #!/bin/bash So rather than trying to keep track of all those, it seems like a better idea to simply check the membership of every user on the system (using dsmemberutil), and that's what the shell function and the script below do. read /Groups/ mygroup GroupMembership isn't guaranteed to output all, or even any, of mygroup's members, because membership also comes from users' primary group ID, membership by user's UUID, inheritance of membership from one group to another, and memberships that are calculated by the system, such as the group everyone. ![]() ![]() There are five different ways (that I know of) that a user can be member of a group in OS X. ![]() Some explanation for those who are interested: There's no standard command that lists all members of a group in OS X, so here's a shell function which does that: members () Ĭopy the above command-line to the Terminal, and then type members mygroup (where mygroup is the name of an existing group).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |