Reset passsword for list of domain users

Great for for getting all Windows related scripts.

Reset passsword for list of domain users

Postby Praveen » Sat Dec 19, 2009 2:55 pm

please find the below script for resetting list of domain users.
'###########Script created by Praveen Kumar##################
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("./users.txt", 1) ' text file input for list of users
Do until objFile.AtEndOfStream
strPassword = "Password" 'enter the default password
intPwdValue = "0"
Line = objFile.ReadLine
Set objUser = GetObject("LDAP://" & Line)
If objUser.class="user" then ' just to make sure the object is user or not
objUser.SetPassword strPassword
objUser.Put "PwdLastSet", intPwdValue
objUser.SetInfo
End If
loop
User avatar
Praveen
Site Admin
 
Posts: 84
Joined: Sat Apr 25, 2009 2:21 pm

Return to Windows Scripting/WMI/VBScript

Who is online

Users browsing this forum: No registered users and 0 guests

cron