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

RE: Ldapsearch - how to retrieve multiple pages



Without knowing what ldap server you're running, I had some trouble pulling
out enough records from an MS Exchange 5.5 ldap directory.  Turns out
Exchange limited the number of records returned.  

For that, you go to the Site (green ball thing) > Configuration > Protocols
> LDAP (Directory) Site Defaults.  Then go to the Search tab, and change the
Maximum number of search results returned box.  I can't remember if I had to
restart the service or not.

I'd made a company phonebook that grabbed name, email, phone out of
exchange, and put it into a web page, using python.  I used
organizationalperson, telephoneNumber, title, and mail.  It was fun.

--
Andrew Diederich

-----Original Message-----
From: John Horne [mailto:J.Horne@plymouth.ac.uk]
Sent: Tuesday, September 24, 2002 10:51
To: openldap-software@OpenLDAP.org
Subject: Ldapsearch - how to retrieve multiple pages


Hello,

Below is a question I sent to the Linux redhat mailing list earlier today.
I received some replies, but most of which said, albeit not definitely, that
ldapsearch could not do what I wanted. It was suggested I ask on this list
instead. 

-----------------------
We have a Microsoft windows server running ldap, and I am trying to obtain a
list of all the users in the ldap server. There are about 20,000 in total. I
can retrieve about 1000 using 'ldapsearch'. I'm trying this from a redhat
7.0 pc, a Solaris 9 Sun system (which has openldap on it), and a redhat 7.2
system. 

The problem is I know little about ldap as such and have no dealing with the
server. I gather there is a limit imposed of returning 1000 records (a
'page' I am told) each time. My question though is how do I tell ldapsearch
to 'get the next 1000 records', so that I can create a loop and retrieve all
the records? I have looked through the man page, the openldap web site,
google search, redhat list search (couldn't get onto the actual redhat list,
but tried the valhalla one). Examples I have seen say to use something like
'ldapsearch -b ... -h ... -w .... (objectclass=*)' and it will return all
the records. Not true. It returns the number of records allowed by the
server, not all the records.

I'm sure this is an easy question, but as said I don't really know ldap
since we don't run any linux/unix ldap servers at all, I'm just trying to
create a small script using the client to return all the records.
---------------------------


Many thanks,

John.

------------------------------------------------------------------------
John Horne, University of Plymouth, UK           Tel: +44 (0)1752 233914
E-mail: jhorne@plymouth.ac.uk
PGP key available from public key servers