Site icon Franky's Web

Exchange 2016: HealthCheck URLs for load balancers

The status of individual Exchange protocols can be easily determined via a URL. This is particularly interesting for load balancers, as it is easy to determine whether the protocol is available on the respective server. Querying the respective URLs is more meaningful than simply checking whether the port on the Exchange server is still open, but is not as load-intensive as logging on to a mailbox.

The Exchange HealthCheck URLs allow load balancers to determine whether connections should continue to be sent to the server or whether the server should be removed from the pool.

The HealthCheck pages themselves offer little information:

"200 OK" can be used as an indication for the load balancer to continue sending connections to the server. For other status codes, the load balancer should remove the server from the pool. Elaborate tests of load balancers with login to a mailbox etc. can therefore be omitted and do not cause any additional load on the Exchange servers.

The URLs for Exchange 2016 and Exchange 2013 SP1 are as follows:

The HealthCheck URLs can also be helpful for error diagnosis, for example if the ComponentStates are not set to the "Active" status again after an update.

With this small PowerShell script, the HealthCheck URLs can be queried:

$ExchangeServer = "EXSRV1.frankysweb.local"

#$AllProtocols = [System.Net.SecurityProtocolType]'Tls11,Tls12'
#[System.Net.ServicePointManager]::SecurityProtocol = $AllProtocols

$OWA = "https://$ExchangeServer/owa/healthcheck.htm"
$ECP = "https://$ExchangeServer/ecp/healthcheck.htm"
$RPC = "https://$ExchangeServer/rpc/healthcheck.htm"
$EWS = "https://$ExchangeServer/ews/healthcheck.htm"
$MAPI = "https://$ExchangeServer/mapi/healthcheck.htm"
$OAB = "https://$ExchangeServer/oab/healthcheck.htm"
$EAS = "https://$ExchangeServer/Microsoft-Server-ActiveSync/healthcheck.htm"
$AutoDiscover = "https://$ExchangeServer/autodiscover/healthcheck.htm"

$OWAResponse = (Invoke-WebRequest -Uri $OWA).RawContent
if ($OWAResponse -match "200 OK
")
	{
		write-host "OWA: OK" -foregroundcolor green
	}
else
	{
		write-host "OWA: Error" -foregroundcolor red
	}

$ECPResponse = (Invoke-WebRequest -Uri $ECP).RawContent
if ($ECPResponse -match "200 OK
")
	{
		write-host "ECP: OK" -foregroundcolor green
	}
else
	{
		write-host "ECP: Error" -foregroundcolor red
	}
	
$RPCResponse = (Invoke-WebRequest -Uri $RPC).RawContent
if ($RPCResponse -match "200 OK
")
	{
		write-host "RPC: OK" -foregroundcolor green
	}
else
	{
		write-host "RPC: Error" -foregroundcolor red
	}
	
$EWSResponse = (Invoke-WebRequest -Uri $EWS).RawContent
if ($EWSResponse -match "200 OK
")
	{
		write-host "EWS: OK" -foregroundcolor green
	}
else
	{
		write-host "EWS: Error" -foregroundcolor red
	}
	
$MAPIResponse = (Invoke-WebRequest -Uri $MAPI).RawContent
if ($MAPIResponse -match "200 OK
")
	{
		write-host "MAPI: OK" -foregroundcolor green
	}
else
	{
		write-host "MAPI: Error" -foregroundcolor red
	}
	
$OABResponse = (Invoke-WebRequest -Uri $OAB).RawContent
if ($OABResponse -match "200 OK
")
	{
		write-host "OAB: OK" -foregroundcolor green
	}
else
	{
		write-host "OAB: Error" -foregroundcolor red
	}
	
$EASResponse = (Invoke-WebRequest -Uri $EAS).RawContent
if ($EASResponse -match "200 OK
")
	{
		write-host "EAS: OK" -foregroundcolor green
	}
else
	{
		write-host "EAS: Error" -foregroundcolor red
	}
	
$AutodiscoverResponse = (Invoke-WebRequest -Uri $Autodiscover).RawContent
if ($AutodiscoverResponse -match "200 OK
")
	{
		write-host "Autodiscover: OK" -foregroundcolor green
	}
else
	{
		write-host "Autodiscover: Error" -foregroundcolor red
	}

The output of the script is simple and can therefore only be used for initial diagnosis (if at all):

Exit mobile version