Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

LDAP error at MS_Exchange Server  RSS feed

Kalyan Chakravarthy
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when a user registers on our website, we have to create a mailbox
an ASP page on MS Exchange Server5.5 on a Windows NT4.0 with IIS4.0 and
ADSI2.5 installed on it.
Since i am new to this please bear with my simple queries and help me
here is my questionaire...
1. Do i need to install anything else on my server for this job?
2. Do i need to change any settings on my Exchange server or IIS?
3. How do i check the version of LDAP running on the system?
4. I have not installed any LDAP server on my system as it seems MS
5.5 has a built-in one. Is this true?
Now let me tell you the trials i have made.
1. Due to reported conflicts in Port number 386 used by LDAP by default
i have changed it to 777
following is the code which i am using to create a mail box. in this
code 2. I am trying to first logon to the NT Server, for creating a
mailbox, with administrator rights.
i guess the logon itself fails. So i need some help in this area also.
3. Now i am trying to create a mailbox and then trying to associate it
with an existing NT account.

OrgName = "nuis"
SiteName = "kyzencs"
strUserName = "administrator" ' this user has admin rights on winnt
strPassword =""
LoginId = "kalyan" 'mailbox name to create
FirstName = "Kalyan"
LastName = "Chakravarthy"
'Start Logon to NT
strADsPath = "WinNT://venus"
Set oADsObject = GetObject(strADsPath)
Dim strADsNamespace
Dim oADsNamespace
strADsNamespace = left(strADsPath, instr(strADsPath,
set oADsNamespace = GetObject(strADsNamespace)
Set oADsObject = oADsNamespace.OpenDSObject(strADsPath,
strUserName, strPassword, 0)
'End Logon to NT
'Start Getting the SID for the user ID to which all mailboxes are
with by using ADSItools component
dim varSecurityID
Set objSIDComp = Server.CreateObject("ADSITools.ExNTSID")
varSecurityID = objSIDComp.GetMySID("venus", "kyzencs",
'End Getting the SID for the user ID that all mailboxes are associated

'Start Creating the mailbox in the DS with ADSI
strPath = "LDAP://venus:777/o=" & OrgName & "/ou=" & SiteName
Set recipcont_obj = GetObject(CStr(strPath))
'LDAP Name...should be same as alias
Set recip_obj = recipcont_obj.Create("organizationalPerson",
recip_obj.Put "mailPreferenceOption", 0
recip_obj.Put "sn", LastName 'Last Name
recip_obj.Put "cn", LoginId 'Mailbox Name
recip_obj.Put "givenName", FirstName 'First Name
recip_obj.Put "uid", LoginId 'Alias
recip_obj.Put "Home-MTA", "cn=Microsoft MTA,cn=" & ServerName &
& SiteName & ",o=" & OrgName
recip_obj.Put "Home-MDB", "cn=Microsoft Private MDB,cn=" &
& ",cn=Servers,cn=Configuration,ou=" & SiteName & ",o=" & OrgName
Response.Write varSecurityID
recip_obj.Put "Assoc-NT-Account", (varSecurityID) 'Associate this
mail box with a primary Windows Account of Administrator
recip_obj.Put "mail", LoginId & "@" & Domain 'SMTP Address
recip_obj.setinfo ' commit the contents of the adsi object to the

'End Creating the mailbox in the DS with ADSI
Response.Write "Success... Your new MailBox created."
using this code i am getting the following error:error '80072021'
Kyle Brown
Ranch Hand
Posts: 3892
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK. Let me understand. This is a web site about Java. This is a forum about J2EE (JAVA 2 Enterprise Edition). Why are you asking a question about ASP here? This bears no relation to Java or J2EE whatsoever...
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!