?
Solved

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

Posted on 2013-06-24
4
Medium Priority
?
2,781 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
If you troubleshoot Outlook for clients, you may want to know a bit more about the OST file before doing your next job. IMAP can cause a lot of drama if removed in the accounts without backing up.
In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…
This video discusses moving either the default database or any database to a new volume.
Suggested Courses
Course of the Month15 days, 16 hours left to enroll

743 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