| |
le_zeou
Posts: 1
Score: 0
Joined: 5/10/2007
Status: offline
|
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 %>
|
|