Monday, January 12, 2009

How to Export User mailboxes and its size into Excel spreadsheet

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+

1 comment:

advmovers said...

Best Moving Company +971 50 3605353
Office and staff relocation should run as professionally and cost efficiently as any successful business. Therefore ADV MOVERS Corporate aim to provide you with the best moving services and moves without any comebacks.

Movers in Dubai
office movers in dubai
Affordable Moving Company in Dubai
Packer in Dubai
Re locate services in Dubai
Professional Movers in Dubai
Movers and Packers Abu Dhabi


http://www.advmovers.com/