Solved

Exporting email addresses into .CSV of around 20 mailboxes?

Posted on 2016-07-27
4
55 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 14

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

Join & Write a Comment

Utilizing an array to gracefully append to a list of EmailAddresses
OfficeMate Freezes on login or does not load after login credentials are input.
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…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager

746 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

9 Experts available now in Live!

Get 1:1 Help Now