Unfortunately, you cannot rely on the Exchange 2010 shell if you want to find out which patch level the Exchange server has. The Exchange shell always returns build 123.4:
In the Exchange 2010 shell, only the latest service pack for Exchange 2010 is displayed (SP3), but not the update rollup packages:
A better way to determine the build number and thus the patch level is to compare the file version of exsetup.exe with the list of Exchange build numbers. Exsetup.exe always has the version of the last installed update package.
The following command can be used to obtain the build number of the exsetup.exe file.
Get-Command Exsetup.exe | ForEach {$_.FileversionInfo}
The file version then provides the Exchange build number:
To find out which patch level the Exchange Server has, you can now check the following pages:
In the case shown, this is Exchange Server 2010 UR 16:
(Yes, someone made a mistake here, it should be 14.3.339.0, not 13.3.339.0)
The command can also be extended a little and put into a loop so that all Exchange servers can be checked at the same time:
$ExchangeServers = Get-ExchangeServer | Sort Name ForEach ($ExchangeServer in $ExchangeServers) { Invoke-Command -ComputerName $ExchangeServer.Name -ScriptBlock {Get-Command Exsetup.exe | ForEach {$_.FileversionInfo}} }
The command works with all Exchange Server versions. However, Exchange 2016 shows the correct build in the shell so far:
This is Exchange 2016 CU 4: