I have been following this for a while and thought i'd try and help out with some VBScript code that lists the LegacyExchangDN for all servers.
You can then copy and paste it into the box asking for the "Server Domain Name".
Hope this helps,
Sunny
'=====================================================================================================
' VBScript Source File -- Created with Notepad(TM)
' NAME: GetLegExcDN
' AUTHOR: Sunny Sharma, Fujitsu
'
' VERSION: 1.0 17/02/2007 - Initial version.
'
' COMMENT: Enumerates ALL Exchange Servers for their legacyExchangeDN attribute
'=====================================================================================================
' Ensure the host is CScript.exe as there will be many Exchange Servers to display
If (Not IsCScript()) Then
WScript.Echo "Due to way this script outputs information, you must use the CSCRIPT.EXE engine to launch this script."
WScript.Quit
End If
'Configure the ADSI connection
Set objRootDSE = GetObject("LDAP://rootDSE")
strADsPath = "LDAP://" & objRootDSE.Get("configurationNamingContext")
Set objConfiguration = GetObject(strADsPath)
Set oConnection = CreateObject("ADODB.Connection")
Set oRecordset = CreateObject("ADODB.Recordset")
Set oCommand = CreateObject("ADODB.Command")
oConnection.Provider = "ADsDSOObject"
oConnection.Open "ADs Provider"
'Get All Exchange Server Names with LeagcyExchangeDN value
strQuery = "<" & stradspath & ">;(objectClass=msExchExchangeServer);cn,legacyExchangeDN;subtree"
oCommand.ActiveConnection = oConnection
oCommand.CommandText = strQuery
oCommand.Properties("Page Size") = 100
Set oRecordset = oCommand.Execute
WScript.Echo "There are in total " & oRecordset.recordcount & " Exchange Servers"
wscript.Echo
wscript.Echo "Exchange Server Name" & vbtab & "legacyExchangeDN"
While Not oRecordset.EOF
sExchServerName = oRecordset.Fields("cn")
sDN = oRecordset.Fields("legacyExchangeDN")
wscript.echo sExchServerName & vbtab & sDN
oRecordset.MoveNext
Wend
'==========================================================================
'Functions
'==========================================================================
Function IsCScript()
' check whether CScript.exe is the host
If (Instr(UCase(WScript.FullName), "CSCRIPT") <> 0) Then
IsCScript = true
Else
IsCScript = false
End if
End function