[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


Exporting email addresses into .CSV of around 20 mailboxes?

Posted on 2016-07-27
Medium Priority
Last Modified: 2016-08-05
Hi guys,

If we wanted to export the email addresses of lets say around 20 mailboxes into a .CSV, how would we do that in Exchange 2010 shell?

For example, if we have a list of the name of the mailboxes like the below, then what would be the best way to export their email addresses without having to do each one individually?


Thanks a lot
Question by:Yashy
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
LVL 16

Accepted Solution

FOX earned 1000 total points
ID: 41731634
If you have the list of users/mailboxes in a list.   Name the list mailboxes.txt  Your exchange shell command will be

 Get-Content "c:\filepath\mailboxes.txt" | Get-Mailbox | Ft SamAccountName, EmailAddress | out-file "c:\temp\emailaddresses.csv"
LVL 12

Assisted Solution

by:Tej Pratap Shukla ~Dexter
Tej Pratap Shukla ~Dexter earned 500 total points
ID: 41732432
Run below command in EMS to export email addresses to CSV file:
Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,ServerName,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}} | Export-Csv c:\mailbox_alias.csv

Open in new window


Author Comment

ID: 41733122
Fabulous guys, thanks for your help.
LVL 16

Assisted Solution

by:Todd Nelson
Todd Nelson earned 500 total points
ID: 41733292
First, create a CSV file with a list of the users you want to output email addresses for.  I called the file "MailboxList.csv".  The CSV must have a header and look similar to this...


Next run these two commands...

The first will import the information using "MailboxList.csv" into an array.

$MyAddresses = Import-Csv "C:\MailboxList.csv" | ForEach-Object { Get-Recipient -Identity $_.Mailboxes | select Name, Alias, PrimarySmtpAddress }

The second will use the array to output the name, alias and primary email address into a CSV file for each of the users you provided in "MailboxList.csv".

$MyAddresses | Export-Csv "C:\MyEmailAddresses.csv" -NoTypeInformation

Hope this helps.

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
As much as Microsoft wants to kill off PST file support, just as they tried to do with public folders, there are still times when it is useful or downright necessary to export Exchange mailboxes to PST files. Thankfully, it is still possible to e…
This video discusses moving either the default database or any database to a new volume.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Suggested Courses

649 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