Solved

Exchange 2010 Shell Command to Find SMTP Addresses and mailbox Size

Posted on 2013-11-12
7
1,377 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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
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

Independent Software Vendors: 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!

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.
A list of top three free exchange EDB viewers that helps the user to extract a mailbox from an unmounted .edb file and get a clear preview of all emails & other items with just a single click on mailboxes.
This video discusses moving either the default database or any database to a new volume.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

749 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