Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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: user@domain.com - 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 user@domain.com 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.

Solved

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

2 Answers 2

up vote 3 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: http://bytes.com/topic/unix/answers/648158-extract-email-addresses-big-file

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 ExtractEmail.pl <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

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

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

http://www.joeware.net/freetools/tools/adfind/index.htm

share|improve this answer

Your Answer

 
discard

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.