Link to home
Start Free TrialLog in
Avatar of Albert Widjaja
Albert WidjajaFlag for Australia

asked on

How to get the mailbox size for each and total of a specific OU ?

Hi,

By using Powershell, is there any way to get the mailbox size for each of the member of specific OU and display the total at the bottom ?

This is for Exchange Server 2007
Avatar of Dhananjay
Dhananjay
Flag of India image

Avatar of SubSun
Try this..
$UserList = Get-mailbox –OrganizationalUnit “Domain.com/IT/Users” -ResultSize Unlimited | Get-MailboxStatistics
$UserList | Select Displayname,TotalItemSize;`
Write-host "`nTotal mailbox size $(($UserList | %{$_.TotalItemSize.value.toMB()} | Measure-Object -Sum).sum) MB"

Open in new window

If required you can export the details to .csv file using
$UserList | Select * | Export-Csv C:\report.csv -NoTypeInformation
Avatar of Albert Widjaja

ASKER

Subsun,
Thanks for the script,
but somehow the ItemSize is still displayed in Bytes, any idea how to change it into Mega Bytes or even Gigabytes ?
SOLUTION
Avatar of SubSun
SubSun
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks, that only changes the total sum at the bottom but not per mailbox size ?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks !