scripts to find out mailboxes size based on OU
Hi all,
Exchange 2007 SP3
Is there a way to get each user mailbox size based on OU through powershell?
Thank you.
August 7th, 2011 8:23pm
Get-Mailbox -OrganizationalUnit | get-mailboxstatistics ( you can then select fields from get-mailboxstatistics)
Free Windows Admin Tool Kit Click here and download it now
August 7th, 2011 9:11pm
Use the below script to export the mailbox sizes of all users in a particular OU. Replace the "OU Name" in the script with the intended OU.
The script will export the output in a CSV file.
###################################################################################
Get-Mailbox -ResultSize Unlimited | Where {$_.OrganizationalUnit -eq "OU Name"} | Select DisplayName | foreach {
$MailboxStat = Get-MailboxStatistics -identity $_.displayName
Add-Member -InputObject $_ noteProperty UseDefault $MailboxInfo.UseDatabaseQuotaDefaults
Add-Member -InputObject $_ noteProperty WarningQuota $MailboxInfo.IssueWarningQuota
Add-Member -InputObject $_ noteProperty SendQuota $MailboxInfo.ProhibitSendQuota
Add-Member -InputObject $_ noteProperty SendRecieveQutoa $MailboxInfo.ProhibitSendReceiveQuota
Add-Member -InputObject $_ noteProperty QuotaStatus $MailboxStat.StorageLimitStatus
Add-Member -InputObject $_ noteProperty TotalItems $MailboxStat.ItemCount
Add-Member -InputObject $_ noteProperty TotalSizeMB $MailboxStat.TotalItemSize.Value.ToMB()
Add-Member -InputObject $_ noteProperty DeleteItems $MailboxStat.DeletedItemCount
Add-Member -InputObject $_ noteProperty DeletedSizeMB $MailboxStat.TotalDeletedItemSize.Value.ToMB() -PassThru
} | Export-Csv -Path C:\MailboxSize.csv
###################################################################################
August 7th, 2011 10:38pm
Hi John,
Any updates?
Frank Wang
Free Windows Admin Tool Kit Click here and download it now
August 9th, 2011 3:25am
Hi Mahendra,
Thank you very much and the script works beautifully.
August 11th, 2011 12:34pm