Get-Mailboxinfo Powershell script

$script:totalSize += ([System.Int64]$mailbox.Size)
$script:totalItems += ([System.Int32]$mailbox.TotalItems)
$script:totalDeleted += ([System.Int64]$mailbox.DeletedMessageSizeExtended)
$script:totalMailboxes += 1
}
}
}
}

“Mailbox name Mailbox size Item count Deleted size” | Out-File $OutPutFile -append
“==================================================================================” | Out-File $OutPutFile -append
Get-MailBoxInfo

“==================================================================================” | Out-File $OutPutFile -append
$string = ($script:totalMailboxes.ToString(“N0”) + " mailboxes").PadRight(40)
$string += $script:totalSize.ToString(“N0”).PadLeft(12) + " KB"
$string += $script:totalItems.ToString(“N0”).PadLeft(9) + " "
$string += $script:totalDeleted.ToString(“N0”).PadLeft(12) + " KB"
$string | Out-File $OutPutFile -append
“==================================================================================” | Out-File $OutPutFile -append

[/sourcecode]

comments powered by Disqus