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 am looking for a way to export an Exchange 2007 Distribution List to SMTP addresses. Ideally a VB or PowerShell script that lets me specify the list I am interested in and returns the list of members' smtp addresses is what I am looking for.

Thanks for any help you can offer!

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

If the primary SMTP address is enough:

Get-DistributionGroupMember <List Name> | fl PrimarySmtpAddress

If it isn't:

Get-DistributionGroupMember <List Name> | fl EmailAddresses

(The last one will also include non-SMTP addresses, so it may require some post-processing.)


Edit:

The best course of action would be to use the Exchange Management Shell, which is built for that; but if you can't use it, standard PowerShell can still help you:

Import-Module ActiveDirectory
Get-ADGroupMember <List Name> | Get-ADUser -Properties EmailAddress | fl EmailAddress 
share|improve this answer
    
That's Exchange Management Shell (PowerShell with Exchange-specific cmdlets). –  Massimo Feb 13 '12 at 21:01
    
Thanks for your help. However, I don't have access to the Exchange Management Tools. Is there another method to access this remotely without installing them? –  RobM Feb 13 '12 at 21:46
    
@RobM: See edit. –  Massimo Feb 13 '12 at 22:05
add comment

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.