• 1. London, UK
  • 2. New York, NY
  • 3. Sydney, Australia
  • 4. Melbourne, Australia
  • 5. Paris, France
  • 6. Bangalore, India
  • 7. Amsterdam, Netherlands
  • 8. San Francisco, CA
  • 9. Hong Kong
  • 10. Houston, TX

Friday, March 03, 2006

 

HOW TO: Find an email address in Active Directory

Posted by Bharat Suneja at 12:52 AM
Every once in a while you try to assign a particular address to a recipient in AD Users & Computers, only to be told someone already has that address! Email addresses need to be unique - two recipients cannot 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

Labels: , ,

12 Comments:

January 3, 2007 5:03 AM
Anonymous Anonymous said...

Many thanks; a very useful tip!

 
January 8, 2007 4:34 PM
Anonymous Anonymous said...

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

 
May 10, 2007 8:11 AM
Anonymous Anonymous said...

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

Thanks

 
June 20, 2007 9:20 AM
Anonymous Anonymous said...

Muchas gracias. Me ha servidor de gran ayuda

 
February 13, 2008 2:49 AM
Anonymous Anonymous said...

Thanks! Option number 3 works a dream!

Daniel Harrison

 
April 18, 2008 8:43 AM
Anonymous Anonymous said...

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

 
October 13, 2008 5:53 AM
Anonymous Anonymous said...

Excellent Thx!

 
November 4, 2008 2:34 PM
Anonymous Anonymous said...

thank you! thank you! thank you! This worked perfect...

 
July 2, 2009 4:00 AM
Anonymous Wayne said...

Thank you, LDAP query worked a treat!

 
August 11, 2009 3:46 PM
Anonymous Anonymous said...

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) :-)

 
October 28, 2009 4:36 AM
Anonymous Dunxd said...

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.

 
November 19, 2009 8:07 AM
Anonymous Anonymous said...

PERFECT!

 

Post a Comment

Links to this post:

Create a Link

<< Home