Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > error '80072020' <== On : "objUser.CreateMailBox

Reply
Thread Tools

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

 
 
lezeou@hotmail.com
Guest
Posts: n/a
 
      05-10-2007
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

%>

 
Reply With Quote
 
 
 
 
ThatsIT.net.au
Guest
Posts: n/a
 
      05-11-2007

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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

%>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xffc Thread 0x228 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 0 03-30-2006 03:16 PM
Error connecting to SQLExpress 2005 locally (error: 26 - Error Locating Server/Instance Specified) hfk0 ASP .Net 2 03-27-2006 08:43 PM
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x8fc Thread 0x934 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 1 03-24-2006 04:20 PM
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x8fc Thread 0x934 DBC 0x437b94 Jet'. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr bazzer ASP .Net 0 03-24-2006 02:22 PM
Error 500: ERROR: Cannot forward. Writer or Stream already obtained. Error JavaQueries Java 1 03-01-2005 06:30 PM



Advertisments