Checking Exchange 2010 Database Health with PowerShell

1 Comment » Written on August 18th, 2010 by
Categories: Exchange, PowerShell
Tags: , ,

Just a quick script that checks your database health. Anything besides ‘Healthy’ or ‘Mounted’ should probably be investigated. :)

Add-PSSnapin *0* -ErrorAction SilentlyContinue
$mailboxservers = get-mailboxserver | get-exchangeserver | ?{$_.IsE14OrLater -eq 'True'}
$A = (get-host).UI.RawUI
$A.WindowTitle = "Database Health Check"
$B = $A.windowsize
$B.width = 110
$B.height = 30
$A.WindowSize = $B
while ($true) {cls; foreach ($mailboxserver in $mailboxservers){Get-MailboxDatabaseCopyStatus -Server $mailboxserver.name | ft -AutoSize Name,*Status,ContentIndexState,CopyQueueLength,ReplayQueueLength} ;sleep 5}

This it the output, refreshed every 5 seconds:

An example of when databases are actually doing something:

Subscribe – To get an automatic feed of all future posts subscribe to our RSS feed here or subscribe via e-mail here. You should follow us on Twitter here.

Tags: , ,

One Response to “Checking Exchange 2010 Database Health with PowerShell”


Leave a Reply