Solved

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

Posted on 2013-06-24
4
2,582 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
  • 2
4 Comments
 
LVL 19

Expert Comment

by:Patricksr1972
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 19

Expert Comment

by:Patricksr1972
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
In this video we show how to create a User Mailbox 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 Recipients >> Mailb…
This video discusses moving either the default database or any database to a new volume.

831 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