From: Babu VT on
Hi,

I have a text file with email address (exchange users) of users.I need to
pull their DN from AD.Does someone have a code snippet to share on which I
can build.

cheers
Babu


From: Richard Mueller [MVP] on

"Babu VT" <babuvt(a)hotmail.com> wrote in message
news:%23zRwydMqKHA.1544(a)TK2MSFTNGP06.phx.gbl...
> Hi,
>
> I have a text file with email address (exchange users) of users.I need to
> pull their DN from AD.Does someone have a code snippet to share on which I
> can build.
>
> cheers
> Babu

I have an example VBScript program you can use linked here:

http://www.rlmueller.net/GenericADO.htm

When the program prompts for the base of the query, enter nothing for the
entire domain. When the program prompts for the LDAP syntax filter, you can
use something similar to:

(mail=jsmith(a)mycompany.com)

where the email address you want is jsmith(a)mycompany.com. When the program
prompts for a comma delimited list of attribute values to retrieve, you
don't need to enter anything, since DN is always included. The above assumes
you use the "mail" attribute on the "General" tab of ADUC. If you have
Exchange, the filter may be similar to:

(proxyAddresses=SMTP:jsmith(a)mycompany.com)

If you want to write your own VBScript program to use ADO to query AD for
this, see this link:

http://www.rlmueller.net/ADOSearchTips.htm

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


 | 
Pages: 1
Prev: Read value in txt file
Next: on keypress