ID command

Not sure if anyone here will be able to help me with this. Trying to write a script which needs to lookup your group memberships at login.

I am using the id command in terminal (id -Gn) to show which groups I am a member of on the active directory my mac is connected to. The id command doesn't display all the groups I am a member of, it just cuts off after 3.5 lines. Anyone have any ideas? gpresult in windows shows everything and I have tested with other users here and they all get cut off at the same point.

Thanks for your time.

PowerBook G4, Mac OS X (10.4.2)

Posted on Apr 24, 2006 9:58 AM

Reply
7 replies

Apr 24, 2006 12:46 PM in response to Michael Conniff

Thanks for the suggestion. I tried that command and it just shows the local groups on this mac and doesn't appear to query the active directory the way the ID command does.

The employees here are a member of a number of groups, the ones with a lot of groups seem to be the issue. I agree, this many groups is unusual, and difficult to work with!

Thanks again,
John

Apr 25, 2006 2:52 AM in response to John Locke

John
it just shows the local groups on this mac
Ah, yes it would do that because of the '.'. You need to put in a 'domain' which includes your active directory stuff. Since I don't use AD, I'm not entirely sure how to do that.

Do all your groups show up in the NetInfo Manager application? If so that might give you a clue how to specify a broader domain, or I'm sure others here will leap in!

Apr 25, 2006 8:06 AM in response to John Locke

You can query the Active Directory using the "dscl" command.

sudo dscl "/Active Directory/your.ad.domain" -read /Users/yourUserID

will give you a dump of the AD record for "yourUserID".

sudo dscl "/Active Directory/your.ad.domain" -read /Users/yourUserID memberOf

will list just the groups the user is a member of (although they're not listed in the same "domain\group" format that the id command gives you).

See "man dscl" for more details.

Steve

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.

ID command

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