Etat du script: Fonctionnel
Présentation:
Le script:
Option Explicit Dim objOU, objUser, objRootDSE Dim strContainer, strDNSDomain, strPassword Dim intCounter, intAccValue, intPwdValue strContainer = "OU=OU-PARENT, " strPassword = "PASSWORD" intAccValue = 512 intPwdValue = 0 intCounter = 0 Set objRootDSE = GetObject("LDAP://RootDSE") strDNSDomain = objRootDSE.Get("DefaultNamingContext") strContainer = strContainer & strDNSDomain set objOU =GetObject("LDAP://" & strContainer ) For each objUser in objOU If objUser.class="user" then objUser.SetPassword strPassword objUser.SetInfo 'objUser.Put "pwdLastSet", intPwdValue 'objUser.SetInfo objUser.Put "userAccountControl", intAccValue objUser.SetInfo intCounter = intCounter +1 End if next WScript.Echo strPassword & " is Password. UserAccountValue = " _ & intAccValue & vbCr & intCounter & " accounts changed" WScript.Quit
Page générée en 0.008 secondes