Finding All E-mail Addresses in Exchange

This DSQUERY lists all e-mail addresses in Exchange, and Active Directory including Public Folders, Contacts and User mailboxes.

dsquery * forestroot -scope subtree -filter “(&(mail=*)(proxyaddresses=smtp:*))” -attr proxyaddresses - limit 10000

The output is a bit messy but nothing a little bit on time in vim can’t fix. Bharat Suneja has a very elegant script that does the same thing but it doesn’t include the SMTP addresses of public folders.



Google