MsExchange Blog Spot Telnet25

January 12, 2009

How to Export User mailboxes and its size into Excel spreadsheet

Filed under: General (1) — telnet25 @ 9:00 pm

Task:

This is classic one and I am sure there are tons of examples on the internet. Report all mailboxes, names, and their size in exchange 2007. This task is very simple and easy to achieve with exchange 2007.

Solution:

Log into exchange server or management PC and open Exchange EMS (Shell). Either copy paste or type the fallowing command into EMS. Ps: Where ever you are running this cmdlet from there will be a file created as “MailReport.csv”, open it with excel and format it as you wish.    

Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | select DisplayName,@{expression={$_.TotalItemSize.Value.ToKB()}},ItemCount |export-csv MailReport.csv

 

Here is another one gives same report for per database (you need to change the below variables to your own)

  • Exchange server name: EXC07
  • Storage group name: SG01
  • Database name: SG01MB1

Get-MailboxStatistics -Database “Exc07\SG01\SG01MB1” | select DisplayName, ItemCount, TotalItemSize | export-csv -path e:\Reports\SG1.csv

 

This example, I have created folder on the e drive called “Reports”. When you have the output open with Excel and format it as you wish

So the sum it up

  • Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | select DisplayName,@{expression={$_.TotalItemSize.Value.ToKB()}},ItemCount |export-csv MailReport.csv
  • Get-MailboxStatistics -Database “Exc07\SG01\SG01MB1” | select DisplayName, ItemCount, TotalItemSize | export-csv -path e:\Reports\SG1.csv

 

Thanks,

Oz

Oz ozugurlu

Oz ozugurlu MVP (Exchange)

MCITP (EMA), MCITP (EA) MCITP (SA),

MCSE (M+, S+) MCDST,

Security+, Server +, Project+

Advertisements

1 Comment »

  1. Great Article!! How about pulling just the users that have ActiveSync enabled??

    Comment by Frank Askew — January 23, 2009 @ 4:53 pm | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: