Home > Exchange 2010 > Get Alias and Mailbox Size

Get Alias and Mailbox Size

Over the past few weeks, I have had a job sitting in my list of things to do which I was struggling to get done. I was asked to produce a list of Exchange 2007 users alias and mailbox sizes so they could plan  batches of user migrations.

I found it difficult to actually get the alias and mailbox size, I found numerous orf scripts and post that I thought were going to work but none of them did. Along comes my good Friend Gavin to the rescue with the below code. What made me laugh was every other script had half a page of code and Gavins version only a few. His blog can be found http://gavinwoodall.wordpress.com

Put the below in a PS.1 file and give it a whirl.

$userlist = get-mailboxdatabase -server <Servername> | get-mailbox

foreach ($user in $userlist)

{

$useralias = $user.alias

write-host $useralias

$usermbsize = Get-MailboxStatistics $user.displayname | select-object TotalItemSize

$usermbsize = $usermbsize.totalitemsize.value.toMB()

$out = $useralias + “,” + $usermbsize + “,” + $user.displayname

write-host $out

$Out | Out-File C:\ptusers.csv -Append

}

Advertisements
Categories: Exchange 2010
  1. Cory
    December 3, 2013 at 11:23 pm

    Nice script… used it against Exchange 2010.
    Thank you.

  1. September 11, 2014 at 2:11 am

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

%d bloggers like this: