Count Persons (objects derived from 'person')
ldapsearch [-h hostname] -D "cn=root" -w '?' -b "o=/usr/local,c=de" -s sub 'objectclass=person' dn | grep -c =
-w '?' will prompt for a password (without echo)-s scope search scope (base, one, or sub)dn is a dummy output attribute (distinguished name is printed in any case)— Courtesy of Oliver D. 2010/05/04 15:04