PowerShell: Exchange 2007 mailbox database details V3

[array]$MailboxDatabaseTable = @()
$dbs = Get-MailboxDatabase -status
foreach ($db in $dbs)
{
if ($db.Mounted -eq “True”)
{
$dbstats = Get-MailboxStatistics -database $db
$totaldbsize = 0
$totalmbcount = 0
foreach ($dbstat in $dbstats)
{
$totalmbcount = $totalmbcount + 1
$totaldbsize = $totaldbsize + $dbstat.TotalItemSize.Value.ToMB()
}
[psobject]$MailboxDatabaseRow = new-object ‘psobject’;
Add-Member -inputObject $MailboxDatabaseRow -type noteproperty -name ‘Identity’ -value $db.Identity.ToString();
Add-Member -inputObject $MailboxDatabaseRow -type noteproperty -name ‘TotalMB’ -value $totalmbcount;
Add-Member -inputObject $MailboxDatabaseRow -type noteproperty -name ‘TotalSize’ -value $totaldbsize;
Add-Member -inputObject $MailboxDatabaseRow -type noteproperty -name ‘SendQuotaMB’ -value $db.ProhibitSendQuota.Value.ToMB();
Add-Member -inputObject $MailboxDatabaseRow -type noteproperty -name ‘ReceiveQuotaMB’ -value $db.ProhibitSendReceiveQuota.Value.ToMB();
Add-Member -inputObject $MailboxDatabaseRow -type noteproperty -name ‘WarningQuotaMB’ -value $db.IssueWarningQuota.Value.ToMB();
[array]$MailboxDatabaseTable += , $MailboxDatabaseRow;
}
}

Geschreven door:

Arnout van der Vorst

Arnout van der Vorst is Identity Management Architect bij Tools4ever en al ruim 10 jaar in dienst. Arnout legt zich als Architect toe op het bedenken en ontwikkelen van nieuwe features, oplossingen en diensten van Tools4ever die aansluiten op de vraag uit de markt. Arnout studeerde Hogere Informatica aan de Hogeschool van Utrecht.
Terug