1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| Function CreateMailBox(UserFirstName,UserLastName)
On Error Resume Next
UserName = "CN= " & UserFirstName & " " & UserLastName
'
' ... Impersonification ...
'
Call Impersonate()
Set objUser = GetObject("LDAP://" & UserName & ",CN=Users,DC=test,DC=local")
Response.Write(Err.Description)
If objUser Is Nothing Then
Response.Write("<font color='FF0000'>Echec - GetObject objUser - CreateMailBox</font><br>")
Else
Response.Write("<font color='008000'>GetObject objUser OK</font><br>")
Set objMailBox = objUser.CreateMailbox("LDAP://CN=Banque de boîtes aux lettres (SERVER)," &_
"CN=Premier groupe de stockage," &_
"CN=InformationStore," &_
"CN=SERVER," &_
"CN=Servers," &_
"CN=Premier groupe d'administration," &_
"CN=Administrative Groups," &_
"CN=TEST," &_
"CN=Microsoft Exchange," &_
"CN=Services," &_
"CN=Configuration," &_
"DC=test," &_
"DC=local")
Response.Write(Err.Description & " " & Err.Number & "<br>")
If objMailBox Is Nothing Then
Response.Write("<font color='FF0000'>Echec - CreateMailBox - CreateMailBox</font><br>")
Else
Response.Write("<font color='008000'>GetObject objMailBox OK</font><br>")
objMailBox.SetInfo
End If
End If
End function |
Partager