Export ALL EmailAddresses in the domain into separate cells

Christian Hans
Christian Hans used Ask the Experts™
How can I export a listing of ALL "PrimarySMTPAddress" and "EmailAddresses" users have in Exchange 2013?

When I try exporting using Get-Mailbox | FL | Select-Object DisplayName,UserPrincipalName,PrimarySMTPAddress,EmailAddresses

I export all the data but is there a way to separate or expand out the EmailAddresses output instead of having it all in one field?

I just want an export that allows me to filter later in excel by ALL domain names actually being used by users, functional or not.

Thanks in advance.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Get rid of the Format-List in the middle of the pipeline.
Try this

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

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial