Solved

Exchange 2010 Shell Command to Find SMTP Addresses and mailbox Size

Posted on 2013-11-12
7
1,331 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 41

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
Why spend so long doing email signature updates?

Do you spend loads of your time carrying out email signature updates? Not very interesting are they? Don’t let signature updates get you down. Let Exclaimer Cloud - Signatures for Office 365 make managing email signatures a breeze.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
In this video we show how to create a Shared Mailbox 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 >> Sha…
In this video we show how to create an Accepted Domain 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 >> Ac…

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

14 Experts available now in Live!

Get 1:1 Help Now