Skip to content
onenote4exchange

Exchange Server health check in 10 minutes with PowerShell

A quick routine to check services, component states, database copies, queues and certificates on Exchange Server on-premises.

2 min read

When something feels slow, or before any change window, a short and repeatable health check tells you whether your Exchange servers are really fine. Every command below runs in the Exchange Management Shell and only reads data.

1. List your servers and versions

Get-ExchangeServer | Format-Table Name, ServerRole, Edition, AdminDisplayVersion -AutoSize

Check that every server shows the build you expect. A server left behind on an older Cumulative Update is a common source of odd behaviour.

2. Required services

Get-ExchangeServer | ForEach-Object { Test-ServiceHealth -Server $_.Name } |
    Where-Object { -not $_.RequiredServicesRunning } |
    Format-List Role, ServicesNotRunning

No output means every required service is running.

3. Server component states

Components left Inactive after maintenance are a classic cause of mail not flowing to one server.

Get-ExchangeServer | ForEach-Object {
    Get-ServerComponentState -Identity $_.Name | Where-Object State -ne "Active"
} | Format-Table Identity, Component, State -AutoSize

Some components (for example ForwardSyncDaemon or ProvisioningRps) are inactive by design on-premises. Focus on ServerWideOffline, HubTransport, FrontendTransport and the protocol proxies.

4. Database copies (DAG)

Get-MailboxDatabaseCopyStatus * |
    Sort-Object Name |
    Format-Table Name, Status, CopyQueueLength, ReplayQueueLength, ContentIndexState -AutoSize

You want Mounted or Healthy, queue lengths close to zero and a Healthy content index.

5. Transport queues

Get-ExchangeServer | ForEach-Object { Get-Queue -Server $_.Name } |
    Where-Object MessageCount -gt 10 |
    Format-Table Identity, DeliveryType, Status, MessageCount, NextHopDomain -AutoSize

6. Certificates that expire soon

Get-ExchangeCertificate | Where-Object { $_.NotAfter -lt (Get-Date).AddDays(60) } |
    Format-Table Thumbprint, Subject, NotAfter, Services -AutoSize

Go further: HealthChecker

Microsoft's free HealthChecker script from the CSS-Exchange project produces a full HTML report per server (build, .NET, TLS, security settings and more): aka.ms/ExchangeHealthChecker.

Keep the results in OneNote

Paste each run into a dated OneNote page in your Exchange notebook. After a few weeks you have a baseline, and the next time something looks off you can compare against a known good day.

  • #exchange-server
  • #powershell
  • #monitoring

Questions about this article or a project of your own?

Keep reading