473,473 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

error '80072020' <== On : "objUser.CreateMailBox

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.CreateMailBox
strHomeMDB"

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

Do you have an idea ?? Thanks

<% @Language=VBScript%>

<%
strFirstName = Request.Form("FirstName")
strLastName = Request.Form("LastName")
struser = Request.Form("Trigramme")
strCompany = Request.Form("Company")
strVille = Request.Form("Ville")

strUserAdmin = "domain\administrator"
strPassword = "xxxxxx"
Const ADS_SECURE_AUTHENTICATION = 1
Const ADS_USE_ENCRYPTION = 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(strLastName) & " " & 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("defaultNamingContext")
strChaine = "LDAP://" & strServerPerso & "/" & strContainer &
strDNSDomain

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

Set objContainer = objDSO.OpenDSObject(strChaine, strUserAdmin,
strPassword, ADS_USE_ENCRYPTION OR ADS_SECURE_AUTHENTICATION)
Set objNewUser = objContainer.Create("User", "CN=" & strDisplayName)

' Personalisation de l'utilisateur
objNewUser.Put "sAMAccountName", LCase(strUser)
objNewUser.Put "givenName", strFirstName
objNewUser.Put "DisplayName", strDisplayName
objNewUser.Put "sn", UCase(strLastName)
objNewUser.Put "initials", UCase(strUser)
objNewUser.Put "company", strCompany
objNewUser.Put "userPrincipalName", LCase(strUser) & "@domain.fr"
objNewUser.SetInfo
objNewUser.setpassword "xxxxxx"
objNewUser.Put "PwdLastSet", 0
objNewUser.SetInfo
objNewUser.Put "userAccountControl", intAccValue
objNewUser.SetInfo
objNewUser.accountdisabled = FALSE
objNewUser.SetInfo

'Creation de la Boite aux Lettres
MStore = "LDAP://CN=Banque de boîtes aux lettres (" & strServerMail &
")" &_
",CN=Premier groupe de stockage" &_
",CN=InformationStore" &_
",CN=" & strServerMail &_
",CN=Servers" &_
",CN=" & strGroupMail &_
",CN=Administrative Groups,CN=XXXXX,CN=Microsoft
Exchange,CN=Services,CN=Configuration," & strDNSDomain

objNewUser.SetInfo
Set objMailbox = objNewUser

objMailbox.CreateMailbox MStore
objNewUser.SetInfo

%>

May 10 '07 #1
1 4442

<le****@hotmail.comwrote in message
news:11*********************@l77g2000hsb.googlegro ups.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.CreateMailBox
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=VBScript%>

<%
strFirstName = Request.Form("FirstName")
strLastName = Request.Form("LastName")
struser = Request.Form("Trigramme")
strCompany = Request.Form("Company")
strVille = Request.Form("Ville")

strUserAdmin = "domain\administrator"
strPassword = "xxxxxx"
Const ADS_SECURE_AUTHENTICATION = 1
Const ADS_USE_ENCRYPTION = 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(strLastName) & " " & 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("defaultNamingContext")
strChaine = "LDAP://" & strServerPerso & "/" & strContainer &
strDNSDomain

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

Set objContainer = objDSO.OpenDSObject(strChaine, strUserAdmin,
strPassword, ADS_USE_ENCRYPTION OR ADS_SECURE_AUTHENTICATION)
Set objNewUser = objContainer.Create("User", "CN=" & strDisplayName)

' Personalisation de l'utilisateur
objNewUser.Put "sAMAccountName", LCase(strUser)
objNewUser.Put "givenName", strFirstName
objNewUser.Put "DisplayName", strDisplayName
objNewUser.Put "sn", UCase(strLastName)
objNewUser.Put "initials", UCase(strUser)
objNewUser.Put "company", strCompany
objNewUser.Put "userPrincipalName", LCase(strUser) & "@domain.fr"
objNewUser.SetInfo
objNewUser.setpassword "xxxxxx"
objNewUser.Put "PwdLastSet", 0
objNewUser.SetInfo
objNewUser.Put "userAccountControl", intAccValue
objNewUser.SetInfo
objNewUser.accountdisabled = FALSE
objNewUser.SetInfo

'Creation de la Boite aux Lettres
MStore = "LDAP://CN=Banque de boîtes aux lettres (" & strServerMail &
")" &_
",CN=Premier groupe de stockage" &_
",CN=InformationStore" &_
",CN=" & strServerMail &_
",CN=Servers" &_
",CN=" & strGroupMail &_
",CN=Administrative Groups,CN=XXXXX,CN=Microsoft
Exchange,CN=Services,CN=Configuration," & strDNSDomain

objNewUser.SetInfo
Set objMailbox = objNewUser

objMailbox.CreateMailbox MStore
objNewUser.SetInfo

%>

May 11 '07 #2

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

Similar topics

3
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
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...
0
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") = ""...
0
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...
0
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 ...
1
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...
0
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....
0
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...
0
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...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
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...
0
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...

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.