This script will help to provide a mini health assessment of your Exchange 2007 Mailbox server role.
Insert the PowerShell information into a PS1 file and you should be good to go or download the complete PS1 here: mailboxMiniHealthAssessment_v1.ps1 (1.87 kb).
For more info, see the blog post here.
|
Get-Date | Select-Object Date | convertTo-HTML -head $a -Title "HealthCheck" | Out-File c:\MBHealthReport.htm $a = $a + "<style>" $a = $a + "BODY{background-color:#717d7d;}" $a = $a + "TABLE.sortable thead {border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}" $a = $a + "TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:#827b60}" $a = $a + "TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:#c9c299}" $a = $a + "</style>"
$MBRole = Get-mailboxserver
Foreach ($MBServer in $MBRole) {
convertTo-HTML -head $a -Title "MB Server Health Report" -Body "<H2>$MBServer</H2>" | Out-File c:\MBHealthReport.htm -append test-servicehealth | select-object Role, {$_.ServicesRunning} | convertTo-HTML -body "<Font Color = Black><B>----------------- List Of Core Services That Are Running -----------------</B></Font Color>" | Out-File c:\MBHealthReport.htm -append test-servicehealth | select-object Role,{$_.ServicesNotRunning} | convertTo-HTML -Body "<Font Color = Black><B>----------------- List Of Core Services That Are Not Running -----------------</B></Font Color>" | Out-File c:\MBHealthReport.htm -append Test-mailflow -Identity $MBServer | convertTo-HTML -Body "<Font Color = Black><B>----------------- Test Mail Flow ---------------------</B></Font Color>" | Out-File c:\MBHealthReport.htm -append Test-MAPIConnectivity -Server $MBServer | convertTo-HTML -Body "<Font Color = Black><B>----------------- Test MAPI Connectiivity ---------------------</B></Font Color>" | Out-File c:\MBHealthReport.htm -append Test-SystemHealth -ServerList $MBServer -DownloadConfigurationUpdates:$False 2>&1 | convertTo-HTML -body "<Font Color = Black><B>----------------------- Overall System Health -----------------</B></Font Color>" | Out-File c:\MBHealthReport.htm -append
}
|