Friday, January 9, 2009

Ldap Search - Total Count of Objects in eDirectory

Ldap search command to find out the count of objects in eDirectory

time ldapsearch -x -h 10.48.60.117 -p 389 -D "cn=admin,o=services" -w novell123 -b "ou=users,o=idv" "Objectclass=*" 1:1 | grep -c "dn:"

Options:

1:1 return only the dn of the object
-x is used for simple authentications

1 comment:

jwilleke said...

If you simple want to know how many objects you might try:
ldapsearch -h xxx.xxx.xxx.xxx -p 389 -D cn=admin,ou=administration,dc=willeke,dc=com -w secret -b dc=willeke,dc=com "(subordinateCount>=0)" subordinateCount

-jim