Commands › Exchange Online
Test-ServiceHealth
Test whether all the Microsoft Windows services that Exchange requires on a server have started. The Test-ServiceHealth cmdlet returns an error for any service required by a configured role when the service is set to start automatically and isn't currently running.
Quick start script
# Test-ServiceHealth — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org
# 2. Run and inspect
Test-ServiceHealth | Format-List
# 3. Export for evidence / drift tracking
Test-ServiceHealth | Export-Clixml .\ServiceHealth-$(Get-Date -Format yyyyMMdd).xml
Syntax
Test-ServiceHealth [[-Server] <ServerIdParameter>]
[-ActiveDirectoryTimeout <Int32>]
[-Confirm]
[-DomainController <Fqdn>]
[-MonitoringContext <Boolean>]
[-WhatIf]
[<CommonParameters>]
Parameters (6)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.