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
| DomainDN = "DC=LAN,DC=NET"
nom = "TEST4"
prenom = "Utilisateur4"
admlogin = "admin test"
admpassword = "rezaMP456"
strPath = "LDAP://CN=Users,DC=ENTREPRISE,DC=LAN,DC=NET"
strUsername = "CN=" & admlogin & ",CN=Users,DC=ENTREPRISE,DC=LAN,DC=NET"
Set adsNamespaceLDAP = GetObject("LDAP:" )
Set adsMyObject = adsNamespaceLDAP.OpenDSObject (strPath, admlogin, admpassword, 0)
Set objUser = adsMyobject.Create("User", "cn=" & prenom & " " & nom)
objUser.Put "sAMAccountName", login
objUser.SetInfo
Set objUser = adsMyobject.Create("User", "cn=" & prenom & " " & nom)
Set adsNamespaceLDAP = GetObject("LDAP:" )
Set objMailbox = adsNamespaceLDAP.OpenDSObject ("LDAP://CN=" & prenom & " " & nom & ",CN=Users,DC=ENTREPRISE,DC=LAN,DC=NET", admlogin, admpassword, 0)
objMailbox.CreateMailbox "LDAP://CN=Banque de boîtes aux lettres (MAIL01),CN=Premier groupe de stockage,CN=InformationStore,CN=MAIL01,CN=Servers,CN=Premier groupe d'administration,CN=Administrative Groups,CN=mailorg,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=LAN,DC=NET" |
Partager