473,804 Members | 2,249 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

error '80072020' <== On : "objUser.Create MailBox

Hi,

I'm trying to write an ASP page to create a user with an Exchange
Mailbox.
The user is create very well but i've got this error message when i
try to create the mailbox :
error '80072020' <== On : "objUser.Create MailBox
strHomeMDB"

The string strHomeMDB is good, and the script run perfectly in .vbs
format.

Do you have an idea ?? Thanks

<% @Language=VBScr ipt%>

<%
strFirstName = Request.Form("F irstName")
strLastName = Request.Form("L astName")
struser = Request.Form("T rigramme")
strCompany = Request.Form("C ompany")
strVille = Request.Form("V ille")

strUserAdmin = "domain\adminis trator"
strPassword = "xxxxxx"
Const ADS_SECURE_AUTH ENTICATION = 1
Const ADS_USE_ENCRYPT ION = 2
' Here is where we set the value to enable the account
' 512 = Enable, 514 = Disable.
intAccValue = 512

strServerMail = "XXXXX"
strGroupMail = "XXXXXX"
strServerPerso = "XXXXX"

strDisplayName = UCase(strLastNa me) & " " & strFirstName
strContainer = "OU=" & strVille & ",OU=" & strCompany &
",OU=_Sociétés, "

' Creation du User
Set objRootLDAP = GetObject("LDAP ://" & strServerPerso & "/RootDSE")
Set objDSO = GetObject("LDAP :")
strDNSDomain = objRootLDAP.Get ("defaultNaming Context")
strChaine = "LDAP://" & strServerPerso & "/" & strContainer &
strDNSDomain

'------------------------------------------------
response.write strChaine & "<BR>"
'------------------------------------------------

Set objContainer = objDSO.OpenDSOb ject(strChaine, strUserAdmin,
strPassword, ADS_USE_ENCRYPT ION OR ADS_SECURE_AUTH ENTICATION)
Set objNewUser = objContainer.Cr eate("User", "CN=" & strDisplayName)

' Personalisation de l'utilisateur
objNewUser.Put "sAMAccountName ", LCase(strUser)
objNewUser.Put "givenName" , strFirstName
objNewUser.Put "DisplayNam e", strDisplayName
objNewUser.Put "sn", UCase(strLastNa me)
objNewUser.Put "initials", UCase(strUser)
objNewUser.Put "company", strCompany
objNewUser.Put "userPrincipalN ame", LCase(strUser) & "@domain.fr "
objNewUser.SetI nfo
objNewUser.setp assword "xxxxxx"
objNewUser.Put "PwdLastSet ", 0
objNewUser.SetI nfo
objNewUser.Put "userAccountCon trol", intAccValue
objNewUser.SetI nfo
objNewUser.acco untdisabled = FALSE
objNewUser.SetI nfo

'Creation de la Boite aux Lettres
MStore = "LDAP://CN=Banque de boîtes aux lettres (" & strServerMail &
")" &_
",CN=Premie r groupe de stockage" &_
",CN=Informatio nStore" &_
",CN=" & strServerMail &_
",CN=Server s" &_
",CN=" & strGroupMail &_
",CN=Administra tive Groups,CN=XXXXX ,CN=Microsoft
Exchange,CN=Ser vices,CN=Config uration," & strDNSDomain

objNewUser.SetI nfo
Set objMailbox = objNewUser

objMailbox.Crea teMailbox MStore
objNewUser.SetI nfo

%>

May 10 '07 #1
1 4462

<le****@hotmail .comwrote in message
news:11******** *************@l 77g2000hsb.goog legroups.com...
Hi,

I'm trying to write an ASP page to create a user with an Exchange
Mailbox.
The user is create very well but i've got this error message when i
try to create the mailbox :
error '80072020' <== On : "objUser.Create MailBox
strHomeMDB"

The string strHomeMDB is good, and the script run perfectly in .vbs
format.

Do you have an idea ?? Thanks
a permissions problem i would say


<% @Language=VBScr ipt%>

<%
strFirstName = Request.Form("F irstName")
strLastName = Request.Form("L astName")
struser = Request.Form("T rigramme")
strCompany = Request.Form("C ompany")
strVille = Request.Form("V ille")

strUserAdmin = "domain\adminis trator"
strPassword = "xxxxxx"
Const ADS_SECURE_AUTH ENTICATION = 1
Const ADS_USE_ENCRYPT ION = 2
' Here is where we set the value to enable the account
' 512 = Enable, 514 = Disable.
intAccValue = 512

strServerMail = "XXXXX"
strGroupMail = "XXXXXX"
strServerPerso = "XXXXX"

strDisplayName = UCase(strLastNa me) & " " & strFirstName
strContainer = "OU=" & strVille & ",OU=" & strCompany &
",OU=_Sociétés, "

' Creation du User
Set objRootLDAP = GetObject("LDAP ://" & strServerPerso & "/RootDSE")
Set objDSO = GetObject("LDAP :")
strDNSDomain = objRootLDAP.Get ("defaultNaming Context")
strChaine = "LDAP://" & strServerPerso & "/" & strContainer &
strDNSDomain

'------------------------------------------------
response.write strChaine & "<BR>"
'------------------------------------------------

Set objContainer = objDSO.OpenDSOb ject(strChaine, strUserAdmin,
strPassword, ADS_USE_ENCRYPT ION OR ADS_SECURE_AUTH ENTICATION)
Set objNewUser = objContainer.Cr eate("User", "CN=" & strDisplayName)

' Personalisation de l'utilisateur
objNewUser.Put "sAMAccountName ", LCase(strUser)
objNewUser.Put "givenName" , strFirstName
objNewUser.Put "DisplayNam e", strDisplayName
objNewUser.Put "sn", UCase(strLastNa me)
objNewUser.Put "initials", UCase(strUser)
objNewUser.Put "company", strCompany
objNewUser.Put "userPrincipalN ame", LCase(strUser) & "@domain.fr "
objNewUser.SetI nfo
objNewUser.setp assword "xxxxxx"
objNewUser.Put "PwdLastSet ", 0
objNewUser.SetI nfo
objNewUser.Put "userAccountCon trol", intAccValue
objNewUser.SetI nfo
objNewUser.acco untdisabled = FALSE
objNewUser.SetI nfo

'Creation de la Boite aux Lettres
MStore = "LDAP://CN=Banque de boîtes aux lettres (" & strServerMail &
")" &_
",CN=Premie r groupe de stockage" &_
",CN=Informatio nStore" &_
",CN=" & strServerMail &_
",CN=Server s" &_
",CN=" & strGroupMail &_
",CN=Administra tive Groups,CN=XXXXX ,CN=Microsoft
Exchange,CN=Ser vices,CN=Config uration," & strDNSDomain

objNewUser.SetI nfo
Set objMailbox = objNewUser

objMailbox.Crea teMailbox MStore
objNewUser.SetI nfo

%>

May 11 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
12790
by: - Steve - | last post by:
How do you do the following? if(true) response.write "There was a problem." ***STOP HERE*** more code more code more code
2
4084
by: Christopher Johannsen | last post by:
Good Day: I am working on building a tool Using ASP/COM & IIS5.1 for a non-administrative technical support team to change domain passwords for users. I have the basic interface built and working from my developement machine (Windows XP Pro SP 1A) which is hosting the pages for now. The problem is that when I try to access the site from a browser on a different pc using my credentials (IIS is running in Windows Authentication), it...
0
1216
by: Fabian Baum | last post by:
Hi, i have a problem in the following source code, i cant read the department from the AD ;( where is my mistake? Dim strBrowser 'Brausertyp If Request.ServerVariables("LOGON_USER") = "" Then Response.Status = "401 Unauthorized"
0
2151
by: sunmiester | last post by:
I have an ASP page that retrieves user info. The page runs fine on XP Pro IIS 5.1, however, when i try to run it from a server running W2k Server SP4 or W2K3, it breaks and i get the following error: Error Type: Microsoft VBScript runtime (0x800A000D) Type mismatch Code:
0
1303
by: Ouaes Jamali | last post by:
I am using C# and ASP.Net to create users and mailboxes. I can create an user without any problems but the code Blows up when i try to create a mailbox. Here is the code snippet is am using DirectoryEntry de = new DirectoryEntry(); DirectoryEntry ParentEntry = new DirectoryEntry(); CDOEXM.IMailboxStore Mailbox; ParentEntry.Username = username; ParentEntry.Password = password;
1
1151
by: Rob | last post by:
I have the following code that works well when I run it on localhost, but when I browse to it from another computer i get the error message below. Dim objUser As New DirectoryEntry("LDAP://cn=myName,ou=Tech Support,dc=mydomain,dc=com") Try objUser.Invoke("ChangePassword", Oldpass.Text, newpass.Text) objUser.CommitChanges()
0
1650
by: somebody | last post by:
Hi there I am using VB2005 come up with a small app to reset the user's password in a 2000 AD. I have am able to create the user's account but all fails when I try to set the initial password. the error I got is The filename, directory name, or volume label syntax is incorrect. (Exception from HRESULT: 0x8007007B). when I comment out the setpassword line everthing is working fine.
0
1707
by: whosyodaddy1019 | last post by:
Does anyone have any code that can do this. From what I understand, these are flags in the "userAccountControl" properties but unsure how to get it unchecked. Can anyone help? Imports System Imports System.DirectoryServices Namespace ActiveDirectorySearch Public Class ADSearch Shared Sub main(ByVal strUserName As String)
0
1735
by: rage2001 | last post by:
I have a script (ASP) written which creates an account in AD, creates a folder on our file server and sets its permissions, and then creates a mailbox on the exchange server and sets its permissions... This script use to work fine, and it hasnt been used in 2 months (since we have had no new students since the end of the term). I have part of the script below. There is alot of code above this script which gets executed perfectly....
0
9714
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10599
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10346
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10090
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9173
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6863
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5531
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4308
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.