Problème VB Script
Fermé
Julian3392
Messages postés
17
Date d'inscription
mercredi 13 avril 2016
Statut
Membre
Dernière intervention
20 juillet 2017
-
10 mai 2016 à 10:13
jordane45 Messages postés 37253 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 17 mars 2023 - 10 mai 2016 à 11:02
jordane45 Messages postés 37253 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 17 mars 2023 - 10 mai 2016 à 11:02
A voir également:
- Problème VB Script
- Script vidéo youtube - Guide
- Vb cable - Télécharger - Audio & Musique
- Bash script arguments - Astuces et Solutions
- Lancer script python linux - Forum Ubuntu
- Script download - Télécharger - Édition & Programmation
6 réponses
jordane45
Messages postés
37253
Date d'inscription
mercredi 22 octobre 2003
Statut
Modérateur
Dernière intervention
17 mars 2023
4 551
10 mai 2016 à 10:16
10 mai 2016 à 10:16
Bonjour,
Et en ajoutant le "d" à la fin ?
Et en ajoutant le "d" à la fin ?
adsUser.AccountDisabled = False
Julian3392
Messages postés
17
Date d'inscription
mercredi 13 avril 2016
Statut
Membre
Dernière intervention
20 juillet 2017
2
10 mai 2016 à 10:17
10 mai 2016 à 10:17
Même avec le D.
Cela ne fonctionne pas ..
Cela ne fonctionne pas ..
Julian3392
Messages postés
17
Date d'inscription
mercredi 13 avril 2016
Statut
Membre
Dernière intervention
20 juillet 2017
2
10 mai 2016 à 10:18
10 mai 2016 à 10:18

Voilà mon script.
--
jordane45
Messages postés
37253
Date d'inscription
mercredi 22 octobre 2003
Statut
Modérateur
Dernière intervention
17 mars 2023
4 551
10 mai 2016 à 10:21
10 mai 2016 à 10:21
Merci de nous coller le code DIRECTEMENT sur le forum au lieu d'en mettre une capture écran.
NB: Pense à utiliser les BALISES DE CODE (explications ici : https://codes-sources.commentcamarche.net/faq/10686-le-nouveau-codes-sources-comment-ca-marche#balises-code)
NB: Pense à utiliser les BALISES DE CODE (explications ici : https://codes-sources.commentcamarche.net/faq/10686-le-nouveau-codes-sources-comment-ca-marche#balises-code)
Julien3392
Messages postés
5
Date d'inscription
mercredi 6 janvier 2016
Statut
Membre
Dernière intervention
10 mai 2016
10 mai 2016 à 10:37
10 mai 2016 à 10:37
Voila mon script :
wscript.echo "Le script commence. Cliquez OK pour continuer."
DIM arrRecord
Const ForReading = 1
Set Root = GetObject("LDAP://RootDSE")
DomainPath = Root.Get("DefaultNamingContext")
Set Domain = GetObject("LDAP://" & DomainPath)
Set ou_HR = GetObject("LDAP://OU=UOSio, " & DomainPath)
Set fso = CreateObject ("Scripting.FileSystemObject")
Set tsTextFile = fso.OpenTextFile ("C:\ADSI\SIO.txt",ForReading, False)
While Not tsTextFile.AtEndOfStream 'START OF LOOP
strRecord = tsTextFile.ReadLine
arrRecord = Split (strRecord, ":")
Set adsUser = ou_HR.Create("user","CN="& arrRecord(2))
adsUser.Put"sAMAccountName", arrRecord(2)
adsUser.Put"userPrincipalName", arrRecord(2)
adsUser.AccountDisabled = True
adsUser.sn = arrRecord(0)
adsUser.GivenName = arrRecord(1)
Set grp = GetObject("LDAP://OU=UOSio,DC=siosoft,DC=local")
Set adsUser=Nothing
Wend 'END OF LOOP
tsTextFile.Close
wscript.echo "Eleves créés.", Chr(10),Chr(10),"Cliquez pour finir."
wscript.echo "Le script commence. Cliquez OK pour continuer."
DIM arrRecord
Const ForReading = 1
Set Root = GetObject("LDAP://RootDSE")
DomainPath = Root.Get("DefaultNamingContext")
Set Domain = GetObject("LDAP://" & DomainPath)
Set ou_HR = GetObject("LDAP://OU=UOSio, " & DomainPath)
Set fso = CreateObject ("Scripting.FileSystemObject")
Set tsTextFile = fso.OpenTextFile ("C:\ADSI\SIO.txt",ForReading, False)
While Not tsTextFile.AtEndOfStream 'START OF LOOP
strRecord = tsTextFile.ReadLine
arrRecord = Split (strRecord, ":")
Set adsUser = ou_HR.Create("user","CN="& arrRecord(2))
adsUser.Put"sAMAccountName", arrRecord(2)
adsUser.Put"userPrincipalName", arrRecord(2)
adsUser.AccountDisabled = True
adsUser.sn = arrRecord(0)
adsUser.GivenName = arrRecord(1)
Set grp = GetObject("LDAP://OU=UOSio,DC=siosoft,DC=local")
Set adsUser=Nothing
Wend 'END OF LOOP
tsTextFile.Close
wscript.echo "Eleves créés.", Chr(10),Chr(10),"Cliquez pour finir."
jordane45
Messages postés
37253
Date d'inscription
mercredi 22 octobre 2003
Statut
Modérateur
Dernière intervention
17 mars 2023
4 551
10 mai 2016 à 10:40
10 mai 2016 à 10:40
Et où sont les balises de code ?????
Merci d'éditer ton message pour les y ajouter.
Merci d'éditer ton message pour les y ajouter.
jordane45
Messages postés
37253
Date d'inscription
mercredi 22 octobre 2003
Statut
Modérateur
Dernière intervention
17 mars 2023
4 551
10 mai 2016 à 10:40
10 mai 2016 à 10:40
Merci également de nous indiquer, si il y en a un, le message d'erreur rencontré".
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
Julian3392
Messages postés
17
Date d'inscription
mercredi 13 avril 2016
Statut
Membre
Dernière intervention
20 juillet 2017
2
10 mai 2016 à 10:43
10 mai 2016 à 10:43
Je ne comprends pas les balises de codes.
Par contre le problème viens sur la ligne du
adsUser.AccountDisabled = True
--
Par contre le problème viens sur la ligne du
adsUser.AccountDisabled = True
--
jordane45
Messages postés
37253
Date d'inscription
mercredi 22 octobre 2003
Statut
Modérateur
Dernière intervention
17 mars 2023
4 551
10 mai 2016 à 10:46
10 mai 2016 à 10:46
Tu ne comprends pas les balises de code ???
Et le lien que je t'ai donné .... tu as été voir au moins ?
Lis (et applique) ceci : https://codes-sources.commentcamarche.net/faq/10686-le-nouveau-codes-sources-comment-ca-marche#balises-code
Et le lien que je t'ai donné .... tu as été voir au moins ?
Lis (et applique) ceci : https://codes-sources.commentcamarche.net/faq/10686-le-nouveau-codes-sources-comment-ca-marche#balises-code
Julien3392
Messages postés
5
Date d'inscription
mercredi 6 janvier 2016
Statut
Membre
Dernière intervention
10 mai 2016
10 mai 2016 à 10:56
10 mai 2016 à 10:56
wscript.echo "Le script commence. Cliquez OK pour continuer."
DIM arrRecord
Const ForReading = 1
Set Root = GetObject("LDAP://RootDSE")
DomainPath = Root.Get("DefaultNamingContext")
Set Domain = GetObject("LDAP://" & DomainPath)
Set ou_HR = GetObject("LDAP://OU=UOSio, " & DomainPath)
Set fso = CreateObject ("Scripting.FileSystemObject")
Set tsTextFile = fso.OpenTextFile ("C:\ADSI\SIO.txt",ForReading, False)
While Not tsTextFile.AtEndOfStream 'START OF LOOP
strRecord = tsTextFile.ReadLine
arrRecord = Split (strRecord, ":")
Set adsUser = ou_HR.Create("user","CN="& arrRecord(2))
adsUser.Put"sAMAccountName", arrRecord(2)
adsUser.Put"userPrincipalName", arrRecord(2)
adsUser.AccountDisabled = True
adsUser.sn = arrRecord(0)
adsUser.GivenName = arrRecord(1)
Set grp = GetObject("LDAP://OU=UOSio,DC=siosoft,DC=local")
Set adsUser=Nothing
Wend 'END OF LOOP
tsTextFile.Close
wscript.echo "Eleves créés.", Chr(10),Chr(10),"Cliquez pour finir."
Message d'erreur rencontrer : 8000500D
Erreur sur la ligne : adsUser.AccountDisabled = True
jordane45
Messages postés
37253
Date d'inscription
mercredi 22 octobre 2003
Statut
Modérateur
Dernière intervention
17 mars 2023
4 551
10 mai 2016 à 11:02
10 mai 2016 à 11:02
Regarde ici : https://www.computerperformance.co.uk/
Tu pourras y trouver une début de réponse je pense.
Tu pourras y trouver une début de réponse je pense.