Solved

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

Posted on 2013-01-17
7
1,258 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
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
moving away from .local domain 5 26
Exchange Certificate 5 40
msdos loop until a variable value changes 5 16
exchange, SPF 21 15
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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…
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…

770 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