[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: ldap search and group membership

Hi Sarkar, Sudipta,

                            You can use "Boolean operators" for this type of
search. For example, group "myGroup" and last name of the user (john)
"Smith". Now, To find out all users whose last name is Smith and are members
of  "myGroup",

$ ldapsearch -h -x -b "dc=visolve,dc=com"

# extended LDIF
# LDAPv3
# base <dc=visolve,dc=com> with scope sub
# filter: (&(ou=myGroup)(sn=*mith))
# requesting: ALL

# Smith, myGroup, visolve.com
dn: cn=John,ou=myGroup,dc=visolve,dc=com
sn: Smith
uid: john
ou: myGroup
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
mail: john@visolve.com
userPassword:: ZHVt

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1


----- Original Message ----- 
From: "Sarkar, Sudipta" <Sudipta.Sarkar@workscape.com>
To: <openldap-software@OpenLDAP.org>
Sent: Wednesday, February 04, 2004 12:24 AM
Subject: ldap search and group membership

> Hi,
>    I have an ldap with some users. I also have few groups and each group
has few members. I want to do a search to find out users who match a certain
criteria and are member of a certain group i.e give me all users whose last
name is Smith and are member of say myGroup. Is there any easy way to do
this search.
> Thanks in advance.
> Sudipta
> ***********************************************************************
> This message is intended only for the use of the intended recipient and
> may contain information that is PRIVILEGED and/or CONFIDENTIAL.  If you
> are not the intended recipient, you are hereby notified that any use,
> dissemination, disclosure or copying of this communication is strictly
> prohibited.  If you have received this communication in error, please
> destroy all copies of this message and its attachments and notify us
> immediately.
> ***********************************************************************

Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004