Thursday 22 November 2012

Database Size, WhiteSpace and Users in Exchange 2010

While with Exchange 2007 it wasn’t straightforward or easy to get the size and the available whitespace of your Exchange databases, with 2010 is much easier! Now, the Get-MailboxDatabase cmdlet includes the DatabaseSize parameter and the AvailableNewMailboxSpace parameter which shows the whitespace available.
So, all we have to do is run a script like this:

$DBs = Get-MailboxDatabase -Status | ? {$_.Mounted -eq $True} | Sort Name
ForEach ($db in $DBs)
{
  $DBsize = $db.DatabaseSize.ToMB()
  $DBusers = ($db | Get-Mailbox -ResultSize Unlimited | Measure).Count
  $DBWhiteSpace = $db.AvailableNewMailboxSpace.ToMB()
  Write-Host "$($db.Name), $DBusers, $DBsize, $DBWhiteSpace"
}

No comments:

Post a Comment

New Azure KMS IP and domain Addresses for activation

For Windows virtual machines deployed into Azure using marketplace images you may have created rules in your NSG or firewalls to allow the s...