Tuesday, 7 May 2013

Microsoft: Microsoft Exchange Server 2010 Mailbox Reporting


This Powershell script allows you to easily generate the latest Exchange report that consists of the following information:
  1. Display Name
  2. Database
  3. Issue Warning Quote
  4. Prohibit Send Quota
  5. Prohibit Send Receive Quota
  6. Total Item Size
  7. Item Count
  8. Storage Limit Status
The report is in CSV format and it is stored in C drive.


$AllMailboxes = @()
$Mailboxes = Get-Mailbox -ResultSize Unlimited | Select DisplayName, Database, IssueWarningQuota, ProhibitSendQuota, ProhibitSendReceiveQuota, Alias
foreach ($Mailbox in $Mailboxes){
    $MailboxStats = "" |Select  DisplayName,Database,IssueWarningQuota,ProhibitSendQuota,ProhibitSendReceiveQuota,TotalItemSize,ItemCount,StorageLimitStatus
    $Stats = Get-MailboxStatistics -Identity $Mailbox.Alias
    $MailboxStats.DisplayName = $Mailbox.DisplayName
    $MailboxStats.Database = $Mailbox.Database
    $MailboxStats.IssueWarningQuota = $Mailbox.IssueWarningQuota
    $MailboxStats.ProhibitSendQuota =$Mailbox.ProhibitSendQuota
    $MailboxStats.ProhibitSendReceiveQuota =$Mailbox.ProhibitSendReceiveQuota
    $MailboxStats.TotalItemSize = $Stats.TotalItemSize
    $MailboxStats.ItemCount = $Stats.ItemCount
    $MailboxStats.StorageLimitStatus = $Stats.StorageLimitStatus
    $AllMailboxes += $MailboxStats
}
$AllMailboxes | Export-Csv C:\mailboxsizes.csv -NoTypeInformation

1 comment: