A voir également:
- Script VBS AD avec Excel
- Liste déroulante excel - Guide
- Script vidéo youtube - Guide
- Word et excel gratuit - Guide
- Vbs windows - Accueil - Optimisation
- Déplacer colonne excel - Guide
2 réponses
yg_be
Messages postés
23541
Date d'inscription
Statut
Contributeur
Dernière intervention
Ambassadeur
1 584
et avec ceci ?
objUser.SetPassword ( objExcel.Cells (intRow, 5).Value)
quel est le type de objuser ?
objUser.SetPassword ( objExcel.Cells (intRow, 5).Value)
quel est le type de objuser ?
J'ai testé avec votre réponse mais cela n'a pas marcher.
je vous donne le code en entier. Je suis débutant en scripting donc le type d'objUser je vois pas ce que c'est.
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open ("C:\Documents and Settings\Administrateur.SRV-VILGE\Bureau\test\liste_calsse.xls")
intRow = 2
Do Until objExcel.Cells (intRow,1).Value = ""
Set objOU = GetObject("LDAP://ou=1ereS, ou=Eleves, DC=vilgenis")
Set objUser = objOU.Create ("User", "cn=" & objExcel.Cells (intRow, 1).Value)
objUser.SamAccountName = objExcel.Cells (intRow, 2).Value
objUser.GivenName = objExcel.Cells (intRow, 3).Value
objUser.SN = objExcel.Cells (intRow, 4).Value
objUser.SetPassword ( objExcel.Cells (intRow, 5).Value) <--
objUser.SetInfo
objUser.AccountDisabled = FALSE
objUser.SetInfo
intRow = intRow + 1
Loop
objExcel.quit
je vous donne le code en entier. Je suis débutant en scripting donc le type d'objUser je vois pas ce que c'est.
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open ("C:\Documents and Settings\Administrateur.SRV-VILGE\Bureau\test\liste_calsse.xls")
intRow = 2
Do Until objExcel.Cells (intRow,1).Value = ""
Set objOU = GetObject("LDAP://ou=1ereS, ou=Eleves, DC=vilgenis")
Set objUser = objOU.Create ("User", "cn=" & objExcel.Cells (intRow, 1).Value)
objUser.SamAccountName = objExcel.Cells (intRow, 2).Value
objUser.GivenName = objExcel.Cells (intRow, 3).Value
objUser.SN = objExcel.Cells (intRow, 4).Value
objUser.SetPassword ( objExcel.Cells (intRow, 5).Value) <--
objUser.SetInfo
objUser.AccountDisabled = FALSE
objUser.SetInfo
intRow = intRow + 1
Loop
objExcel.quit