Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2013-01-17
7
1,275 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
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.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

In-place Upgrading Dirsync to Azure AD Connect
This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
In this video we show how to create an email address policy 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…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

791 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