[Date Prev][Date Next]
Re: enumeratin all ldap objects in a LDAP ?
- To: "Adrian Overbury" <email@example.com>
- Subject: Re: enumeratin all ldap objects in a LDAP ?
- From: "André Pereira" <firstname.lastname@example.org>
- Date: Wed, 11 Jun 2008 00:41:18 -0300
- Cc: email@example.com
- In-reply-to: <483FA3D2.firstname.lastname@example.org>
- References: <20080527191013.GC19203@atlas.science-computing.de> <483FA3D2.email@example.com>
I don't think it's a good approach using the root account to run such a simple script.
Maybe it would be better to perform a search operation against the server. The code below might work for you:
ldapsearch -Hldaps://your.server.com -x -b dc=yourDITroot "objectclass=*" dn -D cn=yourRootDN,dc=yourDITroot -W | grep numEntries
On Fri, May 30, 2008 at 3:50 AM, Adrian Overbury <firstname.lastname@example.org
Well, I don't know necessarily what the *best* way is, but I can tell you what the simplest way in. As root on whatever server the openLDAP database is on, run this command:
slapcat | grep "^dn: " | wc -l
That will dump the entire ldap database, grab every "dn: ..." line, which every object will have exactly one of, and run it through wc (the word-counter) and tell it to count the number of lines.
Michael Arndt wrote:
what is a "good" way to enumerate all objects in an open ldap
in order to get a total count of defined objects ?
( how many objects ..)
PS: Sorry if i should know this by reading basic infos
Andre Augusto da Silva Pereira
Linux Certified Professional - LPIC-1
+55 91 8112-6691