2

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!

RobM
  • 23
  • 1
  • 3

1 Answers1

1

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 
Massimo
  • 68,714
  • 56
  • 196
  • 319