Solved

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

Posted on 2013-01-17
7
1,219 Views
Last Modified: 2013-01-17
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
0
Comment
  • 3
  • 3
7 Comments
 
LVL 9

Expert Comment

by:djsharma
ID: 38787460
0
 
LVL 40

Expert Comment

by:Subsun
ID: 38787898
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
0
 
LVL 7

Author Comment

by:Senior IT System Engineer
ID: 38789848
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 ?
0
Why do Marketing keep bothering you?

Is your marketing department constantly asking for new email signature updates? Are they requesting a different design for every department? Do they need yet another banner added? Don’t let it get you down! There is an easy way to manage all of these requests...

 
LVL 40

Assisted Solution

by:Subsun
Subsun earned 500 total points
ID: 38789877
Try
$UserList = Get-mailbox –OrganizationalUnit “Domain.com/IT/Users” -ResultSize Unlimited | Get-MailboxStatistics
$UserList | Select Displayname,@{N="TotalItemSize in MB";E={$_.TotalItemSize.value.toGB()}};`
Write-host "`nTotal mailbox size $(($UserList | %{$_.TotalItemSize.value.toMB()} | Measure-Object -Sum).sum) MB"

Open in new window


If you change the $_.TotalItemSize.value.toMB() to $_.TotalItemSize.value.toGB(), the you will get the result in GB..
0
 
LVL 7

Author Comment

by:Senior IT System Engineer
ID: 38789932
thanks, that only changes the total sum at the bottom but not per mailbox size ?
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 38789953
For per mailbox MB & total MB
$UserList | Select Displayname,@{N="TotalItemSize in MB";E={$_.TotalItemSize.value.toMB()}};`
Write-host "`nTotal mailbox size $(($UserList | %{$_.TotalItemSize.value.toMB()} | Measure-Object -Sum).sum) MB"

Open in new window

For per mailbox GB & total GB
$UserList | Select Displayname,@{N="TotalItemSize in GB";E={$_.TotalItemSize.value.toGB()}};`
Write-host "`nTotal mailbox size $(($UserList | %{$_.TotalItemSize.value.toGB()} | Measure-Object -Sum).sum) GB"

Open in new window

0
 
LVL 7

Author Closing Comment

by:Senior IT System Engineer
ID: 38791882
Thanks !
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Join & Write a Comment

Synchronize a new Active Directory domain with an existing Office 365 tenant
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
In this video we show how to create a Distribution Group in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >>…
To show how to create a transport rule in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Rules tab.:  To cr…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now