ldapsearch -H ldap://ldapserver -D "cn=admin,dc=xxxx,dc=xxx,dc=x" -b
"ou=People,dc=xxxx,dc=xxx,dc=x" -W -x uid -ZZ
will return all the uids and at the bottom you will see something like this

# search result

search: 3

result: 0 Success

# numResponses: 51

# numEntries: 50

On Tue, Sep 9, 2014 at 4:33 PM, Dennis Leeuw <[email protected]> wrote:

> ldapsearch using -LLL only returning the dn and then use | wc -l ?
>
> Dennis
>
> On 09/09/2014 12:11 PM, Sankar P wrote:
>
>> Hi,
>>
>> Is there a way to count the total number of user objects in an AD
>> forest. I do not want the names/details of any of these user objects.
>> But I just want a programmatic way of finding the total number of AD
>> users. Is it possible to achieve ? Could not get anything related from
>> Googling.
>>
>> Thanks.
>>
>>
> ------------------------------------------------------------
> ------------------
>
> De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is
> uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht
> ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender
> direct
> te informeren door het bericht te retourneren. Het Universitair Medisch
> Centrum Utrecht is een publiekrechtelijke rechtspersoon in de zin van de
> W.H.W.
> (Wet Hoger Onderwijs en Wetenschappelijk Onderzoek) en staat geregistreerd
> bij
> de Kamer van Koophandel voor Midden-Nederland onder nr. 30244197.
>
> Denk s.v.p aan het milieu voor u deze e-mail afdrukt.
>
> ------------------------------------------------------------
> ------------------
>
> This message may contain confidential information and is intended
> exclusively
> for the addressee. If you receive this message unintentionally, please do
> not
> use the contents but notify the sender immediately by return e-mail.
> University
> Medical Center Utrecht is a legal person by public law and is registered at
> the Chamber of Commerce for Midden-Nederland under no. 30244197.
>
> Please consider the environment before printing this e-mail.
>
>


-- 
Udai Singh Mehra
Infrastructure Engineering and Operations

Reply via email to