Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to gather a list of all e-mail addresses being used by our Exchange 2003 system, which includes not only the normal user addresses, but distribution groups and aliases as well. I also need the output formatted like: - although, we only have one domain, so even if I can get the user part, that would work.

I don't care about account-association here, I really just need a list of addresses.

How can I go about doing an export of all smtp e-mail addresses from Exchange 2003, including distribution group and alias addresses in the format?

I would prefer something that can be accomplished via the command line so that it can be generated by a script, but it would be just as useful if there is a way to do this manually (read: point and click) as well.

Any ideas? I don't see anything within System Manager that can do this, and my searching isn't turning up anything that can fulfill all the above requirements.


This is how I'm using the accepted answer:

@echo off

ldifde -f c:\temp\ldifde-dump.txt -l proxyaddresses
find "@" < c:\temp\ldifde-dump.txt > c:\temp\email-addresses.txt
del c:\temp\ldifde-dump.txt

This produces c:\temp\email-addresses.txt, which, although it contains a little extra garbage characters, it can easily be parsed out with a search & replace in Notepad++.

share|improve this question
up vote 4 down vote accepted

If you only need primary email addresses, you can run this on your Exchange server, filling in the domain and com values:

csvde -r "(mail=*)" -d "dc=domain,dc=com" -l mail -f c:\gal.csv

To get secondary email addresses, its a bit trickier. You can use this to generate a file:

ldifde -f dump.ldf -l proxyaddresses

Found a method to extract the email addresses from the LDF file here:

If you have access to perl within Windows, make a perl file that contains this:

while (<STDIN>) { 
while (/[\w\.\-]+@[\w\.\-]+\w+/g) 
    {print "$&\n"}} 

Then run this command:

perl <dump.ldf >out.txt

Out.txt should contain all your email addresses.

share|improve this answer
Hrm, Perl is a no-go - server is on the DMZ, but the ldifde command helps a lot. Thanks. – Cypher Dec 1 '10 at 22:31
For those with grep but no perl you can always do something like grep -oP "[\w\._-]+@[\w_]+\.[\w]{2,5}" dump.ldf > emails.txt. Obviously the regex could be expanded as needed, but that fit for my org's relatively straightforward addressing scheme. – May 24 at 18:05

Adfind.exe with this: AdFind.exe -default -nodn -nolabel -noctl proxyAddressess

Chop out all of the SMTP: or smtp: addresses.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.