2.13. Enumerating All Existing Exchange Servers
Problem
As part of an installation, update, migration, or other administrative task, you might want to find out which Exchange servers already exist in an organization.
Solution
Using a graphical user interface
Launch the Exchange System Manager (Exchange System Manager.msc).
Expand the Administrative Groups node, and then expand each AG that appears below it.
Select the Servers node in each AG. The righthand pane contains the servers in that administrative group, along with their type (basic or clustered), edition (enterprise or standard), version, and modification date.
Using a command-line interface
The following command will query Active Directory to find existing Exchange servers and the version of Exchange installed.
> dsquery * "cn=microsoft exchange,cn=services,cn=configuration,<ForestRootDN>"
-filter "(objectCategory=msExchExchangeServer)" -scope subtree -attr name serialNumberUsing VBScript with WMI
' This code uses WMI to interrogate the Exchange routing table
' and list all known Exchange servers.
' ------ SCRIPT CONFIGURATION ------
strComputerName = "<ServerName>" ' e.g., exch01 ' ------ END CONFIGURATION --------- strE2KWMIQuery = "winmgmts://" & strComputerName &_ "/root/cimv2/applications/exchange" strE2K3WMIQuery = "winmgmts://" & strComputerName &_ "/root/MicrosoftExchangeV2" ' display basic attributes using Exchange 2000 WMI provider set serverList = GetObject(strE2KWMIQuery).InstancesOf("ExchangeServerState") for each ...Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access