Powershell – Exchange 2010 EMS – Total size of users mailboxes within a particular OU

exchange-2010powershell

I'm doing some massive DB cleanups at the moment. We have two DBs both approaching 400GB and I'm wanting to split the DB's into departments.

To do that I need to know the total size of mailboxes within an OU. I've run this: https://stackoverflow.com/questions/9796101/exchange-listing-mailboxes-in-an-ou-with-their-mailbox-size but this only gives me a list and I need a combined totalitemsize so know how big I need the new DB's to be.

Thanks

Best Answer

get-mailbox -OrganizationalUnit "OU=Users,DC=yourdomain,DC=local" | Get-MailboxStatistics | Select @{Name="Size";Expression={$_.TotalItemSize.Value.ToMB()}} | Measure Size -Sum -Min -Max -Average

Seems to work for me.