Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Export Emailaddresses (ProxyAddressString comma separated) with Powershell

Posted on 2014-12-17
2
Medium Priority
?
657 Views
Last Modified: 2014-12-17
Hi Experts,

I hope someone can help me.

I try to export Exchange Distribution Lists with the following Powershell command:
Get-DistributionGroup |select Name, DisplayName, Alias, PrimarySmtpAddress, @{Name="EmailAddresses";Expression={$_.EmailAddresses | ForEach-Object {$_.ProxyAddressString}}} |Export-Csv -path "C:\Temp\dl.csv"

Open in new window


As result I get an colloumn EmailAddresses with Values like this:
smtp:GEOAll@domain.com SMTP:GEOAll@domain.com

But I need to get it comma separated like this:
smtp:GEOAll@domain.com, SMTP:GEOAll@domain.com

Do you know how?

It's Exchange 2010 SP3 on Windows Server 2008 R2

Thanks
Daniel
0
Comment
Question by:Honaco
[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 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 2000 total points
ID: 40504462
Try..
Get-DistributionGroup |select Name, DisplayName, Alias, PrimarySmtpAddress, @{Name="EmailAddresses";Expression={($_.EmailAddresses | ForEach-Object {$_.ProxyAddressString}) -join ","}} |Export-Csv -path "C:\Temp\dl.csv"

Open in new window

0
 

Author Closing Comment

by:Honaco
ID: 40504523
Thank you, very much.
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

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

Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
Are you an Exchange administrator employed with an organization? And, have you encountered a corrupt Exchange database due to which you are not able to open its EDB file. This article will explain all the steps to repair corrupt Exchange database.
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

670 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