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
Solved

Exchange 2010 Shell Command to Find SMTP Addresses and mailbox Size

Posted on 2013-11-12
7
1,366 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
7 Comments
 
LVL 42

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 18

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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
In this video we show how to create a Distribution Group 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 Recipients >>…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

792 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