Option Explicit
Dim objOU, objUser, objRootDSE
Dim strContainer, strDNSDomain, strPassword, intAccValue
‘ Bind to Active Directory Domain
Set objRootDSE = GetObject(« LDAP://RootDSE« )
strDNSDomain = objRootDSE.Get(« DefaultNamingContext »)
‘ ————————————————————-‘
‘ Important change OU= to reflect your domain
‘ ————————————————————-‘
strContainer = « OU=Import,DC=ac-rouen,DC=FR »
strPassword = « SCSI »
strContainer = strContainer & strDNSDomain
intAccValue = 512
‘ Loop through OU=, setting passwords for all users
set objOU =GetObject(« LDAP:// » & strContainer )
For each objUser in objOU
If objUser.class= »user » then
objUser.SetPassword strPassword
objUser.Put « userAccountControl », intAccValue
objUser.Put « PwdLastSet », 0
objUser.SetInfo
End If
Next
WScript.Quit