Solved

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

Posted on 2013-01-17
7
1,418 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
[X]
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
  • 3
  • 3
7 Comments
 
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 8

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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 8

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 8

Author Closing Comment

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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
If you troubleshoot Outlook for clients, you may want to know a bit more about the OST file before doing your next job. IMAP can cause a lot of drama if removed in the accounts without backing up.
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

622 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