Checking Exchange 2010 Database Health with PowerShell

Just a quick script that checks your databases. 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:

Possibly Related Posts:

Posted: August 16th, 2010
Categories: Exchange Server, PowerShell
Tags: ,
Comments: 1 Comment.
Comments

[...] this on Jeremy Phillips Exchange site. Good job [...]













CommentLuv badge