All members of nested groups?

Hi,

How do I get all members of say the group 'users', including those that are members of the subgroup 'guest users'? I need it for a script, so command line solutions are preferable.

/Fredrik

Macbook, Mac OS X (10.5.1)

Posted on Feb 22, 2008 5:05 AM

Reply
1 reply

Feb 25, 2008 9:22 AM in response to Dargosch

OK, here is a terminal command that will get the members of a group Users

dscl /LDAPv3/127.0.0.1 read /Groups/Users Member (This will give you the members of the group)

Then you will want to get the Nested Groups

dscl /LDAPv3/127.0.0.1 read /Groups/Users NestedGroups (This will give you the UID of all the nested groups)

Then you will want to match the UID to the group for each nested group

dscl /LDAPv3/127.0.0.1 search /Groups NestedGroups <insert nested group UID>

onve you have the values of each nested group you can get the users of that nested group

dscl /LDAPv3/127.0.0.1 read /Groups/<insert nested group name> Member (This will give you the members of the group)

Hope this helps.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

All members of nested groups?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.