Monday, August 18, 2014

exchange 2013 Archive Mailbox Stats

From msexchange.org

lthough Personal Archives in Exchange 2010 are often in cheaper and larger storage than “normal” mailboxes, we still need to keep an eye on them to check how archives are growing and how (if!) users are using it.
Here’s a simple script to get some statistics regarding all the archive mailboxes in your environment:
 $mbcombCollection= @()
$archiveMbxs= Get-Mailbox -Archive -ResultSize Unlimited | Select Identity, ArchiveWarningQuota, ArchiveQuota
ForEach ($mbxin$archiveMbxs)
{
       $mbxStats= Get-MailboxStatistics $mbx.Identity -Archive | Select DisplayName, StorageLimitStatus, TotalItemSize, TotalDeletedItemSize, ItemCount, DeletedItemCount,Database

       $mbcomb="" | Select"Display Name", StorageLimitStatus, "TotalItemSize (MB)","TotalDeletedItemSize (MB)", ItemCount, DeletedItemCount, Database, "ArchiveWarningQuota (GB)""ArchiveQuota (GB)"

       $mbcomb."Display Name"=$mbxStats.DisplayName
       $mbcomb.StorageLimitStatus =$mbxStats.StorageLimitStatus
       $mbcomb."TotalItemSize (MB)"= [math]::round($mbxStats.TotalItemSize.Value.ToMB(), 2)
       $mbcomb."TotalDeletedItemSize (MB)"=[math]::round($mbxStats.TotalDeletedItemSize.Value.ToMB(), 2)
       $mbcomb.ItemCount =$mbxStats.ItemCount
       $mbcomb.DeletedItemCount =$mbxStats.DeletedItemCount
       $mbcomb.Database =$mbxStats.Database
       $mbcomb."ArchiveWarningQuota (GB)"=$mbx.ArchiveWarningQuota.Value.ToGB()
       $mbcomb."ArchiveQuota (GB)"=$mbx.ArchiveWarningQuota.Value.ToGB()
       $mbcombCollection+=$mbcomb
}
#$mbcombCollection
$mbcombCollection | Export-Csv D:\Scripts\Reports\"ArchiveStats_$(Get-Date -f 'yyyyMMdd').csv"-NoType

No comments:

Post a Comment