Solved

Exchange PowerShell:  Get all Primary SMTP Addresses of members of Distribution List

Posted on 2013-06-24
4
2,717 Views
Last Modified: 2013-06-24
We need all primary SMTP addresses from all members of a particular Distribution List.  We have all kind of members in this DL like Mailboxes, Public Folders, Distribution Lists etc.

How can we get only the primary SMTP addresses of this DL?
0
Comment
Question by:whenz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 23

Expert Comment

by:Patrick Bogers
ID: 39270526
Hi,.

Try this one.

Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,ServerName,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}}
0
 

Author Comment

by:whenz
ID: 39270550
Thanks Patricksr1972, but I need the mail addresses of members of a particular DL.  Please see the attached picture, in this DL we have Mailboxes, Public Folders, Contacts etc.
EE.jpg
0
 
LVL 23

Expert Comment

by:Patrick Bogers
ID: 39270557
Hi,

Clear, you need to specify which DL.

What about this query i read on LINK:
$members = Get-DynamicDistributionGroup -Identity "dynamicgroupname"
Get-Recipient -RecipientPreviewFilter $members.RecipientFilter | select Displayname,PrimarySmtpAddress > membersall.txt
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 39270744
Try..
Get-DistributionGroupMember "Group Name" | Select DisplayName,PrimarySmtpAddress

Open in new window

Replace Select DisplayName,PrimarySmtpAddress with Select PrimarySmtpAddress to get only SmtpAddress
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question