Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #8440

Re: LDAP: How get all users belongs to a group.

From Michael Ströder <michael@stroeder.com>
Newsgroups comp.lang.python
Subject Re: LDAP: How get all users belongs to a group.
Date 2011-06-25 12:20 +0200
Organization A noiseless patient Spider
Message-ID <iu4cqa$tgj$2@dont-email.me> (permalink)
References <542151da-ebfb-4cfb-b83d-14f2ba641bf4@x38g2000pri.googlegroups.com> <iu1ki7$9lt$2@dont-email.me> <34110eed-96bc-499f-9a4e-068f2720fc8b@h12g2000pro.googlegroups.com> <iu28l1$5ob$1@reader1.panix.com> <5a279799-c8cd-4efc-aeea-509dda0a2212@v11g2000prn.googlegroups.com>

Show all headers | View raw


sajuptpm wrote:
> results = ldapClient.search_s("cn=My-Group-1,ou=Groups,o=CUST",
> ldap.SCOPE_BASE)
> 
> Is this method work for all types of groups (groupOfNames,
> posixGroup) ???

Yes, but the member attribute differs.

'member' in entries of object class 'groupOfNames' contains the DN of the
member's entry.

'memberUID' in entries of object class 'posixGroup' contains the 'uid' of the
member's entry if the original RFC 2307 is used. If the LDAP server uses a
draft-howard-rfc2307bis it behaves like groupOfNames.

Also there's object class 'groupOfUniqueNames' used most times on Sun DS which
contains the DN of the member's entry in attribute 'uniqueMember'.

Additionally organizationalRole -> roleOccupant contains DN of the member's
entry...

The default config of my web2ldap contains even more:

--------------------------------- snip ---------------------------------

    # The definitions for group entry administration
    groupadm_defs={
      'groupOfNames':       ('member',None),
      'groupOfUniqueNames': ('uniqueMember',None),
      'organizationalRole': ('roleOccupant',None),
      'rfc822MailGroup':    ('mail','mail'),
      'nisMailAlias':       ('rfc822MailMember','mail'),
      'mailGroup':          ('mgrprfc822mailmember','mail'),
      # Found on IBM SecureWay Directory
      'accessGroup':        ('member',None),
      # RFC2370
      'posixGroup':         ('memberUid','uid'),
      'nisNetgroup':        ('memberNisNetgroup','uid'),
      # Samba 3.0
      'sambaGroupMapping':  ('sambaSIDList','sambaSID'),
      # Active Directory
      'group':              ('member',None),
      # draft-findlay-ldap-groupofentries
      'groupOfEntries':     ('member',None),
      # Apple MAC OS X
      'apple-group':        ('apple-group-memberguid','apple-generateduid'),
    },

--------------------------------- snip ---------------------------------

Ciao, Michael.

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

LDAP: How get all users belongs to a group. sajuptpm <sajuptpm@gmail.com> - 2011-06-23 06:14 -0700
  Re: LDAP: How get all users belongs to a group. Ken Watford <kwatford+python@gmail.com> - 2011-06-23 09:59 -0400
  Re: LDAP: How get all users belongs to a group. Michael Ströder <michael@stroeder.com> - 2011-06-24 11:14 +0200
    Re: LDAP: How get all users belongs to a group. sajuptpm <sajuptpm@gmail.com> - 2011-06-24 02:58 -0700
      Re: LDAP: How get all users belongs to a group. sajuptpm <sajuptpm@gmail.com> - 2011-06-24 03:06 -0700
      Re: LDAP: How get all users belongs to a group. sajuptpm <sajuptpm@gmail.com> - 2011-06-24 03:16 -0700
        Re: LDAP: How get all users belongs to a group. Michael Ströder <michael@stroeder.com> - 2011-06-24 13:02 +0200
      Re: LDAP: How get all users belongs to a group. John Gordon <gordon@panix.com> - 2011-06-24 14:57 +0000
        Re: LDAP: How get all users belongs to a group. sajuptpm <sajuptpm@gmail.com> - 2011-06-25 00:08 -0700
          Re: LDAP: How get all users belongs to a group. Michael Ströder <michael@stroeder.com> - 2011-06-25 12:20 +0200

csiph-web