Posted on 2015-02-13
Last Modified: 2015-02-13
Hello - I need to export all of mail addressed inclusive of alias addresses into a single column CSV file for import into a cloud based Spam filter.

I found this on line

Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,ServerName,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}} | Export-CSV c:\smtp.csv -NoTypeInformation

It is helpful but I need the alias addresses to appear in the 1st column as separate addresses.  Can anyone help I have no idea how to achieve this

LVL 13

Accepted Solution

Guy Lidbetter earned 500 total points
ID: 40607882
Hi Byron..

Give this a go...

$MailAccounts =  Get-Mailbox -Resultsize Unlimited | Select -ExpandProperty EmailAddresses
$MailAccounts.SMTPAddress | Export-CSV <FileName>



EDIT: It only provides a list of all mailbox users email addresses (Primary and Proxy) - nothing else. You would need to do the same for Distribution groups and mail enabled Public folders.

Author Closing Comment

ID: 40608273
Thank you! Perfect

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SCCM 2012 R2 client migration to new site 2 67
Remote access server vs NAP 4 74
Spoofed Email 10 64
OWA address for domain 6 37
Introduction Ever had certain email messages or responses that you find yourself using over and over again? Do you use Google's Gmail system? If so, then this article is here to help you save time by teaching you how to create email templates from …
Know what services you can and cannot, should and should not combine on your server.
The purpose of this video is to demonstrate how to set up Lists in Mailchimp. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchimp account. : Click on Lists. Click on Create List Button : Choose the desi…
This Micro Tutorial demonstrates  how Internet marketers work with competitive analysis data, and a common task in data preparation is creating separate column for domains. You will then extract from a list of URLs.

919 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now