error "80072020" <== On : "objUser.CreateMailBox
am 10.05.2007 22:03:43 von lezeouHi,
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=3DVBScript%>
<%
strFirstName =3D Request.Form("FirstName")
strLastName =3D Request.Form("LastName")
struser =3D Request.Form("Trigramme")
strCompany =3D Request.Form("Company")
strVille =3D Request.Form("Ville")
strUserAdmin =3D "domain\administrator"
strPassword =3D "xxxxxx"
Const ADS_SECURE_AUTHENTICATION =3D 1
Const ADS_USE_ENCRYPTION =3D 2
' Here is where we set the value to enable the account
' 512 =3D Enable, 514 =3D Disable.
intAccValue =3D 512
strServerMail =3D "XXXXX"
strGroupMail =3D "XXXXXX"
strServerPerso =3D "XXXXX"
strDisplayName =3D UCase(strLastName) & " " & strFirstName
strContainer =3D "OU=3D" & strVille & ",OU=3D" & strCompany &
",OU=3D_Soci=E9t=E9s,"
' Creation du User
Set objRootLDAP =3D GetObject("LDAP://" & strServerPerso & "/RootDSE")
Set objDSO =3D GetObject("LDAP:")
strDNSDomain =3D objRootLDAP.Get("defaultNamingContext")
strChaine =3D "LDAP://" & strServerPerso & "/" & strContainer &
strDNSDomain
'------------------------------------------------
response.write strChaine & "
"
'------------------------------------------------
Set objContainer =3D objDSO.OpenDSObject(strChaine, strUserAdmin,
strPassword, ADS_USE_ENCRYPTION OR ADS_SECURE_AUTHENTICATION)
Set objNewUser =3D objContainer.Create("User", "CN=3D" & 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 =3D FALSE
objNewUser.SetInfo
'Creation de la Boite aux Lettres
MStore =3D "LDAP://CN=3DBanque de bo=EEtes aux lettres (" & strServerMail &
")" &_
",CN=3DPremier groupe de stockage" &_
",CN=3DInformationStore" &_
",CN=3D" & strServerMail &_
",CN=3DServers" &_
",CN=3D" & strGroupMail &_
",CN=3DAdministrative Groups,CN=3DXXXXX,CN=3DMicrosoft
Exchange,CN=3DServices,CN=3DConfiguration," & strDNSDomain
objNewUser.SetInfo
Set objMailbox =3D objNewUser
objMailbox.CreateMailbox MStore
objNewUser.SetInfo
%>