Avatar of rymattcart
rymattcartFlag for United States of America

asked on 

Legacy Exchange DN "not set" in exchange 2003

Legacy Exchange DN "not set" in exchange 2003

I am preping for the DST 2007 and have come to a wall.  When attempting to locate my LegacyDN in ADSI it comes up as "not set"
Is there any other location I can find this info?
When/if I find this info should I change the "not set" to reflict this?
Microsoft Server OSWindows Server 2003Exchange

Avatar of undefined
Last Comment
rymattcart
ASKER CERTIFIED SOLUTION
Avatar of TokenCelt
TokenCelt

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of rymattcart
rymattcart
Flag of United States of America image

ASKER

I should hope so as it is our sole exchange server handling all of our email.  How would I verify this?

Thanks I will have a look at the article
Avatar of rymattcart
rymattcart
Flag of United States of America image

ASKER

Found the solutions here:
        -----
Sunny Sharma said:
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
February 17, 2007 3:46 PM
        
SunnyS said:
Forgot to mention that if you want to use the script then copy & paste all the code into notepad.  Save the file as C:\GetLegExcDN.vbs (ensure not as .txt).  Open a command prompt and enter the following :
CSCRIPT C:\GetLegExcDN.vbs

If you want to output to a log file then:
CSCRIPT C:\GetLegExcDN.vbs > c:\out.txt

In my environment Authenticated Users have sufficient rights to read this information - your mileage may vary.

If this was useful or you have an improvement then let everyone here know!

HTH,

Sunny
Exchange
Exchange

Exchange is the server side of a collaborative application product that is part of the Microsoft Server infrastructure. Exchange's major features include email, calendaring, contacts and tasks, support for mobile and web-based access to information, and support for data storage.

213K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo