Exchange 2007 get Mailbox sizes

If you ever have had the pleasure to administer an Exchange system for some time, then you’ve run into the scenario where you need to know how big people’s mailboxes are.  Depending on your workload, I suggest that you take some time regularly take some time to check the sizes of the mailboxes on your server.  Now this is more important if your business doesn’t  now have any limits on their users and you’ve recently noticed a huge spike in the database size.

Exchange 2007 Power Shell gives you the option to get a report of the mailbox sizes which is helpful for a quick glance, but if you want to keep a running tab, then you’re going to want it in a savable format.  Also I tend to want the data in MB and not the default KB, just gives me an easier time looking over it.  That’s the intention of the code below:

Get-MailboxStatistics -Database “DATABASENAME” | Sort -Property DisplayName | ft DisplayName, @{expression={$_.totalitemsize.value.ToMB()};label=”Mailbox Size(MB)”}, itemcount, lastlogontime, lastlogofftime,lastloggedonuseraccount > Database.txt

*NOTE: make sure you replace DATABASENAME with the actual exchange database name.

This code will run and output the information to a text file names Database.txt (or whatever you want to change it to) and you can save this and put it in a report if you like.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.