List all connectors in Exchange (VBScript)

This code can be found in Chapter 2 of Exchange Server Cookbook

Purchase XP Cookbook or Networking Recipes for only $25 plus shipping! While supplies last.

Find out how to download all of the VBScript code from this site.

' This script was originally published in the Exchange Cookbook,
' (http://www.exchangebookcook.com). Written by Paul Robichaux, 
' Missy Koslosky, and Devin Ganger. Redistributed with permission 
' of the publisher, O'Reilly & Associates.

' This code uses WMI to interrogate the Exchange routing table 
' and list all connectors in the Exchange organization.

' ------ SCRIPT CONFIGURATION ------
 strComputerName = "<serverName>"	' e.g. "batman.robichaux.net"
   
' ------ END CONFIGURATION ---------
  strWMIQuery = "winmgmts://" & strComputerName &_
   "/root/cimv2/applications/exchange"
   
  set connectorList= GetObject(strWMIQuery).InstancesOf("ExchangeConnectorState")
  for each ExchangeConnector in connectorList
    WScript.Echo "Name:             " & ExchangeConnector.Name
    WScript.Echo "DN:               " & ExchangeConnector.DN
    WScript.Echo "Routing Group DN: " & ExchangeConnector.GroupDN
    If (ExchangeConnector.IsUp) Then
    	WScript.Echo ("Status:          : Up")
    	Else
    	WScript.Echo ("Status:          : Down")
    End If
  Next
  

This code has been viewed 1713 times.

New from the creators of TechTasks.com: StatSheet.com