LDAP error at MS_Exchange Server
laxman Jan 11, 2002 12:45 AMwhen a user registers on our website, we have to create a mailbox
through
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
out.
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
Exchange
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
server
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
associated
with by using ADSItools component
dim varSecurityID
Set objSIDComp = Server.CreateObject("ADSITools.ExNTSID")
varSecurityID = objSIDComp.GetMySID("venus", "kyzencs",
"Administrator")
'End Getting the SID for the user ID that all mailboxes are associated
with
'Start Creating the mailbox in the DS with ADSI
strPath = "LDAP://venus:777/o=" & OrgName & "/ou=" & SiteName
&"/cn=Recipients"
Set recipcont_obj = GetObject(CStr(strPath))
'LDAP Name...should be same as alias
Set recip_obj = recipcont_obj.Create("organizationalPerson",
Loginid)
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 &
",cn=Servers,cn=Configuration,ou="
& SiteName & ",o=" & OrgName
recip_obj.Put "Home-MDB", "cn=Microsoft Private MDB,cn=" &
ServerName
& ",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
directory
'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'