Bonjour,
J'ai fait le script suivant qui permet de créer un compte utilisateur sur l'Active directory. Il fonctione parfaitement lorsque que je l'execute avec le compte administrateur du domaine, mais lorsque je l'execute avec un compte user "simple" il bloque sur la création de la mailbox (l'user est correctement créer).
J'utilise pourtant l'authentification LDAP avec le compte admin du domaine.

L'erreur renvoyée est la suivante :
create_user.vbs(51, 1) (null): Cet objet ne se trouve pas sur le serveur.

Installation : LDAP Provider
ID de l'erreur : 80072030
Microsoft CDO pour la gestion d'Exchange
Ce qui est faux ...

Voyez vous le problème ?


Code : Sélectionner tout - Visualiser dans une fenêtre à part
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"