The script itself is easy to read. Admittedly, it doesn't do anything except echo the properties of the selected object, but if you don't already know the names and types of the properties in a particular class, using the script is an easy way to find out. With a little tweaking, you could easily turn this script into a tool that could report back on the current DSAccess configuration for all the servers in an domain, Exchange organization, or organizational unit (OU). We won't see the scripting improvements promised for Exchange 12 for a while yet. In the meantime, you'll probably be surprised at how much data you can gather (and how many settings and behaviors you can change) using WMI. Scriptomatic and the related resources at the Scripting Center are a great way to get started with Exchange scripting.
On Error Resume Next
Const wbemFlagReturnImmediately = &h10 Const wbemFlagForwardOnly = &h20
arrComputers = Array("BATMAN","superman") For Each strComputer In arrComputers
WScript.Echo WScript.Echo "=====================================
====================================="
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\MicrosoftExchangeV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Exchange_DSAccessDC", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
WScript.Echo "Caption: " & objItem.Caption
WScript.Echo "ConfigurationType: " & objItem.ConfigurationType
WScript.Echo "Description: " & objItem.Description
WScript.Echo "InstallDate: " & WMIDateStringToDate(objItem.InstallDate)
WScript.Echo "IsFast: " & objItem.IsFast
WScript.Echo "IsInSync: " & objItem.IsInSync WScript.Echo "IsUp: " & objItem.IsUp
WScript.Echo "LDAPPort: " & objItem.LDAPPort
WScript.Echo "Name: " & objItem.Name WScript.Echo "Status: " & objItem.Status
WScript.Echo "Type: " & objItem.Type
WScript.Echo
Next
Next
Function WMIDateStringToDate(dtmDate)
WScript.Echo dtm: WMIDateStringToDate = CDate(Mid(dtmDate, 5, 2) & "/" & _
Mid(dtmDate, 7, 2) & "/" & Left(dtmDate, 4) __
& " " & Mid (dtmDate, 9, 2) & ":" & Mid(dtmDate, 11, 2) & ":" & Mid(dtmDate,13, 2))
End Function