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

Azure Resource Support for Availability Zone

Over the years, an increasing number of services are consumed in the cloud and as architects one of the key considerations is designing the ...