Solved

Exporting email addresses into .CSV of around 20 mailboxes?

Posted on 2016-07-27
4
59 Views
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?

F600,
F601,
F605,
F606,
F607

Thanks a lot
Yashy
0
Comment
Question by:Yashy
4 Comments
 
LVL 16

Accepted Solution

by:
FOX earned 250 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"
0
 
LVL 11

Assisted Solution

by:Tej Pratap Shukla ~Dexter
Tej Pratap Shukla ~Dexter earned 125 total points
ID: 41732432
Hi,
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

0
 
LVL 1

Author Comment

by:Yashy
ID: 41733122
Fabulous guys, thanks for your help.
0
 
LVL 15

Assisted Solution

by:Todd Nelson
Todd Nelson earned 125 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...

Mailboxes
User1
User2
User3

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.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

861 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