Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Exchange 2010 Shell Command to Find SMTP Addresses and mailbox Size

Posted on 2013-11-12
7
Medium Priority
?
1,423 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 44

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 2000 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
Are your AD admin tools letting you down?

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.

 
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
Are you looking for the options available for exporting EDB files to PST? You may be confused as they are different in different Exchange versions. Here, I will discuss some options available.
In this video we show how to create a mailbox database 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 Servers >> Data…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

610 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