How to list Exchange servers and their roles
Problem:
You need to list all your Exchange servers along with their installed roles or check the build version number of your Exchange Server.
Solution:
See this section for newer Exchange Servers, i.e. 2013 or newer, or mixed environments (2007/2010/2013 + 2013/2016/2019).
See this section for older Exchange Servers, i.e. 2007 and 2010.
Exchange 2013 and later, or mixed environments
To get a list of all your Exchange servers, execute the following PowerShell cmdlet in your Exchange Management Shell:
Get-ExchangeServer | select name, serverrole, edition, admindisplayversion, isClientAccessServer | fl
The command above will produce a tailored list of all Exchange servers in your environment with their names, roles, editions and versions displayed.
Fig. 1. An example of the cmdlet output.
Keep in mind that in heterogeneous (mixed) environments, i.e. two or more Exchange servers with different Microsoft Exchange Server versions installed (e.g. Exchange 2010 + Exchange 2013), the above-mentioned cmdlet will display proper results only when executed in the Exchange Management Shell of the newer Exchange Server.
Be aware that if the cmdlet above is executed in Exchange Server 2016 CU2 (build 466.34) or newer, the serverrole property will not display info on the CAS roles installed, and this is by design. In that case, see if the IsClientAccessServer property returns True (which means that your server is CAS).
Fig. 2. The cmdlet output for Exchange 2016 CU2. Notice the CAS role missing in the serverrole property despite IsClientAccessServer returning True.
Exchange 2007 and 2010
To get a list of all your Exchange servers, execute the following PowerShell cmdlet in your Exchange Management Shell:
Get-ExchangeServer | select name, serverrole, edition | fl
The command above will produce a tailored list of all Exchange servers in your environment with their names, roles and edition displayed. However, in Exchange Server 2007 and 2010, the build number displayed by Get-ExchangeServer with AdminDisplayVersion selected does not reflect the actual build number properly. This is by design in Exchange Servers older than 2013.
Now, to get the proper build numbers, go to each of your servers and execute the following cmdlet in the Exchange Management Shell of each server manually (or you can do it remotely, starting Exchange 2010 and later):
Get-Command Exsetup.exe | ForEach-Object {$_.FileVersionInfo}
or use the alias-based, shortened version:
GCM Exsetup.exe | % {$_.FileVersionInfo}
Fig. 3. First result - wrong build, second result - proper build.
See also:
- List of MS Exchange Server builds unsupported by CodeTwo
- Lists of Exchange Server versions and build numbers
- Microsoft blog post in that topic (1) - explanation on the differences in build numbers
- Microsoft blog post in that topic (2) - script ideas on how to gather build numbers from remote servers
Related products: | General (Microsoft 365, Exchange & more) |
Categories: | How-To |
Last modified: | November 3, 2023 |
Created: | December 19, 2014 |
ID: | 449 |