AskME4Tech

We Do the best to understand Technology

You are here:

Export List of Emails Addresses from Exchange Server

Before months i had a request to export size of mailboxes from our Exchange Server. As we know this can't happened from Exchange Management Console except if you start to type in Excel one by one the Users. When you will finish? You don't know. So i use Exchange Management Shell to export all mail enable Users, email addresses from all Databases or from specific databases of Exchange Server and save it in CSV file. It will take maximum 5 minutes. 

As you already know Powershell it's very powerfull and can use it in your day by day tasks to automate your work.

This article can help you with few commands to get Reports in minute from Exchange Server.

But as IT Pro you manage different Systems like Domain Controllers , HYPER-V Hosts , Workstations and more.

In the Category of Powershell you can find more commands and simple tools that can help you to export different types of Reports from Active Directory ,Servers and  Workstations.

Find some intresting articles that maybe want to read after finish with this article

Use Powershell to export Reports from Active Directory

Use WMI with Powershell to Discover Monitor Information

Monitoring Domain Controller Health Status with PowerShell

So let's start !

Login in your Exchange Server

Go Start - - >Exchange Server 2010 - - > Exchange Mnagament Shell.

 

View Mail Enable Users Email Addresses.

Get-Mailbox -ResultSize Unlimited -RecipientType UserMailbox | Select Displayname,EmailAddresses

Export Mail Enable Users Email Addresses in CSV.

Get-Mailbox -ResultSize Unlimited -RecipientType UserMailbox | Select Displayname,EmailAddresses  | Export-csv c:\csv\mailenableusers.csv

View Mail Enable Users Email Addresses from Specific Database.

Get-Mailbox -ResultSize Unlimited -RecipientType UserMailbox -Database "Mailbox Database 0118323219" | Select Displayname,EmailAddresses,Database

Export Mail Enable Users Email Addresses from Specific Database in CSV.

Get-Mailbox -ResultSize Unlimited -RecipientType UserMailbox -Database "Mailbox Database 0118323219" | Select Displayname,EmailAddresses,Database | Export-csv c:\csv\mailenableusersdatabase.csv

View Mail Enable User  Mailboxes included the Size of Mailboxes.

Get-MailboxStatistics -Server dc | Select Displayname,TotalItemSize,ItemCount 

Export Mail Enable User Mailboxes included the Size of Mailboxes in CSV.

Get-MailboxStatistics -Server dc | Select Displayname,TotalItemSize,ItemCount | Export-csv c:\csv\mailboxessize.csv

Until now we use Get-Mailbox command to view or export all mail enable Users. in Exchange Server except from Mail Enable Users we have email addresses from Distribution Groups and Contacts. With Get-Mailbox we ca get only Mail enable user email addresses. So i found another one command Get-Recipient that we can use to export all email addresses from Exchange Server

View all email addresses included Disitribution Groups and Contacts.

Get-Recipient| select name -ExpandProperty emailaddresses | select name,smtpaddress

Export all email addresses included Disitribution Groups and Contacts in CSV.

Get-Recipient| select name -ExpandProperty emailaddresses | select name,smtpaddress  | Export-csv c:\csv\mailboxessize.csv

Export all email addresses from specific Disitribution Group in CSV.

Get-DistributionGroup -Identity <"DistributionGroup Name" | Get-DistributionGroupMember | select name,primarysmtpaddress >C:\Powershell-Exports\dg.txt

If you are intresting to export Reports from Active Directory download our Powershell Tool to do it.

That's it for now.

I will come back next week with new commands.

Do your comments or ask anything that you want here or send me an email in info@askme4tech.com . I will be here to answer your questions.

Best of 2016: 
Best of Month: 

Similar Posts

How to use PowerShell to migrate mailboxes from one database to another in Exchange 2013

Migrating Exchange mailboxes between databases is not your every-day task, and ad

Use Powershell to export Reports from Active Directory

Powershell today is one of the most powerfull tool for IT Pro,System Admins for lot of tasks.

Keep in Touch with Askme4Tech

Twitter icon
Facebook icon
Google+ icon