Solved

Exchange 2010 Shell Command to Find SMTP Addresses and mailbox Size

Posted on 2013-11-12
7
1,382 Views
Last Modified: 2013-12-16
We have Exchange 2010.  I need to have a CSV file from Exchange with the following:


1. All mailboxes in Specific Mailbox Database lets call it MailboxDB01
2.Displayname
3. List it by Email Address
4. List mailbox Size

Now I have the script below which does the job but only grabs me the display name it doesnt show the EMail address.

Get-MailboxDatabase "mailboxdb01" | Get-MailboxStatistics | Sort totalitemsize -desc | ft displayname, EmailAddresses, totalitemsize, itemcount | Out-File c:\myscripts\emailaddresses1.txt
0
Comment
Question by:Twhite0909
[X]
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
7 Comments
 
LVL 43

Expert Comment

by:Amit
ID: 39642227
0
 

Author Comment

by:Twhite0909
ID: 39642749
Thats cool but can I get the cmd as well please?

Thanks
0
 
LVL 19

Accepted Solution

by:
suriyaehnop earned 500 total points
ID: 39643502
try this:

$result = @()
$mbxs = Get-Mailbox -Database exchdc01-mdb01
Foreach ($mbx in $mbxs){

$MbxSize = Get-MailboxStatistics -Identity $mbx.alias

$mailbox = New-Object PSObject
$mailbox | Add-Member -MemberType NoteProperty -Name Displayname -Value $mbx.displayname
$mailbox | Add-Member -MemberType NoteProperty -Name Email       -Value $mbx.primarysmtpaddress
$mailbox | Add-Member -MemberType Noteproperty -Name MailboxSize -Value $MbxSize.TotalItemSize

$result +=$mailbox
}

$result | Format-Table Displayname,email,mailboxsize

Open in new window

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:Vijaya Babu Sekar
ID: 39643776
You can use the below script for Exchange 2010

http://gallery.technet.microsoft.com/office/Generate-report-of-user-e4e9afca

Thanks.
0
 
LVL 12

Expert Comment

by:florin_s
ID: 39644031
Hi,

Here is an article about reporting, here you can find all you need:
http://www.experts-exchange.com/Software/Server_Software/A_12377-Exchange-monitoring-reporting.html
0
 

Author Comment

by:Twhite0909
ID: 39645635
The script that suriyaehnop wreote works but when I try to pipe it into a CSV or TEXT file I get scrambled text.  

I used :

|Export-CSV c:\myscripts\emailaddresses3.txt
0
 
LVL 40

Expert Comment

by:Subsun
ID: 39667190
Try this code and see if it works for you..
$(Foreach ($mailbox in (Get-Mailbox -Database "mailboxdb01" -ResultSize Unlimited)){
$mailbox | 
	Get-MailboxStatistics | 
		Sort totalitemsize -desc | 
			Select displayname,@{N="EmailAddress";E={$mailbox.primarysmtpaddress}}, totalitemsize, itemcount
}) | Export-Csv c:\myscripts\emailaddresses1.csv -nti

Open in new window

0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Read this checklist to learn more about the 15 things you should never include in an email signature.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…

734 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