Site icon Franky's Web

Exchange 2010: Show client connections of CAS servers

From time to time, it can be quite useful to know which CAS server is serving how many client connections. This could be helpful for planned updates or problems with the load balancer.

There are already some scripts, but they do not work on servers with a German operating system / German Exchange installation, as the performance counters that are queried by the script are called differently here.

So here is a version that runs on servers in German and with Exchange 2010:

$casservers = Get-ClientAccessServer

$stats = @()
foreach ($casserver in $casservers)
{
	$casservername = $casserver.name

	$OWA = $NULL
	$RPC = $NULL
	$EAS = $NULL
	$EWS = $NULL
	$POP = $NULL
	$IMAP = $NULL
	
	$OWA = (Get-Counter "\MSExchange OWA\Aktuelle eindeutige Benutzer" -ComputerName $casservername).CounterSamples[0].CookedValue
	$RPC = (Get-Counter "\MSExchange RPCClientAccess\Anzahl Benutzer" -ComputerName $casservername).CounterSamples[0].CookedValue
	$EAS = (Get-Counter "\MSExchange ActiveSync\Anforderungen/Sek." -ComputerName $casservername).CounterSamples[0].CookedValue
	$EWS = (Get-Counter "\MSExchangeWS\Anforderungen/s" -ComputerName $casservername).CounterSamples[0].CookedValue
	$POP = (Get-Counter "\MSExchangePOP3(_total)\Aktuelle Verbindungen" -ComputerName $casservername).CounterSamples[0].CookedValue
	$IMAP = (Get-Counter "\MSExchangeIMAP4(_total)\Aktuelle Verbindungen" -ComputerName $casservername).CounterSamples[0].CookedValue
	
	$OWA = "{0:N0}" -f $OWA
	$RPC = "{0:N0}" -f $RPC
	$EAS = "{0:N0}" -f $EAS
	$EWS = "{0:N0}" -f $EWS
	$POP = "{0:N0}" -f $POP
	$IMAP = "{0:N0}" -f $IMAP
	
	$stats += new-object PSObject -property @{CASServer="$casservername";OWA="$OWA";RPC="$RPC";EAS="$EAS";EWS="$EWS";POP3="$POP3";IMAP4="$IMAP"}
}

$stats | ft

Simply save it in a PS1 file and execute it via the Exchange Management Shell. The output will look something like this:

And yes, the load balancer was the cause here.

Exit mobile version