HOW TO: Find an email address in Active Directory

by Bharat Suneja on March 3, 2006

Every once in a while you try to assign a particular address to a recipient in Active Directory Users & Computers, only to be told someone already has that address! Email addresses need to be unique — two recipients can’t have the same email address.

Here are a few different ways to find out whether an email address is assigned, and the recipient it belongs to.

1 Resolve Recipient: Create a new message in Microsoft Outlook, enter the email address. Press CTRL-K. If the recipient is not hidden from Address Lists/GAL, the email address resolves to the Display Name.

2 Request Delivery Receipt: If the recipient is hidden from Address Lists, send a message to it with a Delivery Receipt requested.

3 ADUC Saved Query: In AD Users & Computers (on Windows Server 2003), right-click Saved Queries container | New | Query.
- Enter a name for the query, and click the Define Query button
- From the Find drop-down – select Custom Search | go to Advanced tab
- In the Enter LDAP Query text box, enter the query:

(proxyAddresses=smtp:postmaster@exchangepedia.com)

This returns recipients of all types – users, mail-enabled contacts, public folders, and groups that have the address postmaster@exchangepedia.com.

Click here to see a Flash demo. [Link updated]

ADUC Saved Queries | Custom Search dialog

4 Using CSVDE/LDIFDE to find an email address: Saved Queries isn’t available in the Windows 2000 version of ADUC. You can also use CSVDE or LDIFDE to export this information to a file, using the following command:

csvde -f outputfilename.csv -d “dc=domain,dc=com” -r “(&(mailnickname=*)(proxyAddresses=smtp:foo@domain.com))” -l name

Replace “dc=domain,dc=com” with your AD domain name and suffix, and foo@domain.com with the exact email address you’re looking for.

To find all recipients who have an email address from a particular SMTP domain, you can use a wildcard, e.g.:

csvde -f outputfilename.csv -d “dc=domain,dc=com” -r “(&(mailnickname=*)(proxyAddresses=smtp:*@domain.com))” -l name

In the above example, only the name field is exported. All CSVDE/LDIFDE queries also return the object’s distinguishedName. To add more fields to the list, insert a coma after name and type new field names separated by a coma: e.g.

name,displayName,sAMAccountName,proxyAddresses,homeMDB

5 Finding email addresses using the Exchange shell (Exchange Server 2007): The Exchange Server 2007 shell makes it easier (once you familiarize yourself with shell basics). To get a list of all recipients with email addresses from a particular domain:

get-recipient | where {$_.emailaddresses -match “domain.com”} | select name,emailaddresses

To get a list of recipients with a particular email address:

get-recipient | where {$_.emailaddresses -match “foo@domain.com”} | select name,emailaddresses

Related Post(s):
1. Update – HOW TO: Find an email address in Active Directory
12/3/2007 – Content from the UPDATE post has been merged with this post to make it convenient for readers.
2. HOW TO: Export all email addresses from a domain

{ 15 comments… read them below or add one }

1 Anonymous January 3, 2007 at 5:03 am

Many thanks; a very useful tip!

Reply

2 Anonymous January 8, 2007 at 4:34 pm

Very nice indeed, this saved me a lot of time – thank-you.

Reply

3 Anonymous May 10, 2007 at 8:11 am

It doesn’t work for me. Am I doing something worng? I have run other queries that work flawlessly. MMMM

Thanks

Reply

4 Anonymous June 20, 2007 at 9:20 am

Muchas gracias. Me ha servidor de gran ayuda

Reply

5 Anonymous February 13, 2008 at 2:49 am

Thanks! Option number 3 works a dream!

Daniel Harrison

Reply

6 Anonymous April 18, 2008 at 8:43 am

We tried everything before checking your site. Option 3 solved our problem! Thanks.

Reply

7 Anonymous October 13, 2008 at 5:53 am

Excellent Thx!

Reply

8 Anonymous November 4, 2008 at 2:34 pm

thank you! thank you! thank you! This worked perfect…

Reply

9 Wayne July 2, 2009 at 4:00 am

Thank you, LDAP query worked a treat!

Reply

10 Anonymous August 11, 2009 at 3:46 pm

I have wondered how to do this for ages (seems weird M$ doesn't make it easier!) – you are collectively amazing people (and alternate sentient life forms) :-)

Reply

11 Dunxd October 28, 2009 at 4:36 am

Would be helpful to have more discussion of wildcards – for example, Exchange handles duplicate email addresses by appending numbers to the end of the user portion of the address. I want to find all addresses that have been created this way – e.g. *2@domain.com. Searching on this in the Saved Query doesn't seem to work.

Reply

12 Anonymous November 19, 2009 at 8:07 am

PERFECT!

Reply

13 Lewis wells October 1, 2010 at 7:06 am

Option 3 sorted my issue also! Bloody email address was assigned directly to a public folder :).

I bet thats half the users who end up here’s problem too!

Reply

14 Ryan December 22, 2010 at 6:47 am

Thanks!! Very useful!

Reply

15 sumon March 12, 2012 at 9:26 pm

nice blog

Reply

Leave a Comment

 

{ 2 trackbacks }

Previous post:

Next post: