' 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 queries the list of DSAccess instances and reports which DCs DSAccess is using. ' ------ SCRIPT CONFIGURATION ------ strServer = "" ' e.g. xch01.foobar.com; the NetBIOS name works too ' ------ END CONFIGURATION --------- ' Get the Exchange Namespace WMI object Set objWMIExch = GetObject("winmgmts:{impersonationLevel=impersonate}!//" &_ strServer & "/root/MicrosoftExchangeV2") ' Get the list of Exchange_DSAccessDC instances and iterate through them ' to display their properties Set listDCInst = objWMIExch.InstancesOf("Exchange_DSAccessDC") strDCInfo = "" For each objDCInst in listDCInst strDCInfo = strDCInfo & "DC: " & objDCInst.Name & " (" Select Case objDCInst.Type Case 0 strDCInfo = strDCInfo & "Configuration DC)" Case 1 strDCInfo = strDCInfo & "Domain Controller)" Case 2 strDCInfo = strDCInfo & "Global Catalog)" End Select Select Case objDCInst.ConfigurationType Case 0 strDCInfo = strDCInfo & " is manually configured." Case 1 strDCInfo = strDCInfo & " was auto-discovered." End Select strDCInfo = strDCInfo & VbCrLF Next Wscript.Echo strDCInfo