Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Querying a large group over 2000 users 1

Status
Not open for further replies.

JojoNo1

Programmer
Jul 14, 2005
7
CA
I am trying to write an LDAP query and I like to get all the users belonging to a certain group, my problem is that the group is too big and when it is big the result set comes back with an error.
I think the only way around it is to get all the users in this group with last name starting with a*, then b*,....
then display them all at once
I tried to write the query time and time again, it did not work and since I saw your name all over the internet when a document or an RFC about LDAP, this is why I addressed this email to you.
my query with an error look liked this:
<LDAP://DC=abcd,DC=abcdefg,DC=Com >;(&(CN=xxx yyyy)(sn=a*));name,distinguishedName,groupType,description,member;subtree

and the below one works when it is a small query not a big one


<LDAP://DC=abcd,DC=abcdefg,DC=Com>;(&(objectCategory=Group)(objectClass=*)name=xxxyyy) ;name,distinguishedName,groupType,description,member;subtree

If you cann help I would be very appreciative.
 
Suppose the dn of the group and the domain defaultnamingcontext (as shown) are known. I would propose the query string as something like this. Could you try it out?
[tt]
srootdse="dc=abcd,dc=abcdef,dc=com"
'the dn of the group
sdn="cn=xxxyyy,ou=cccddd,cn=eeefff" & "," & srootdse
sbase="<LDAP://" & srootdse & ">"
sfilter="(&(objectCategory=Person)(objectClass=User)(memberOf=" & sdn & "))"
sattribute="adspath,dn,sn" 'etc etc depending on the need
sscope="subtree"
squery=sbase & ";" & sfilter & ";" & sattribute & ";" & sscope 'the query string
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top