Jump to content

AutoIT password change script not picking up password


Recommended Posts

Posted

This is the script I have that shows users and then lets you input a password into a box and reset it via that. But I made it output to a msgbox to see its working and all passwords are reset to '25':

 

$passbox = GUICtrlCreateInput("", 750, 65, 50, 20)

Func UpdatePass()
$leftfqdn = ReadFQDNFromGUILeft()
$leftsam = _ADDNToSamAccountName ($leftfqdn)
$ObjUser = ObjGet("LDAP://" & $leftfqdn)
$objUser.SetPassword (GUICtrlRead($passbox))
$objUser.Put ("pwdLastSet", 0)
$objUser.SetInfo ()
MsgBox(0, "", "Password has been reset to " & $passbox & @CRLF & "User will be asked to change password at next logon")
EndFunc

 

everything else i need it to do works, i can update descriptions and usernames etc, its just the password is coming up as that.

its driving me mental!

Posted

can't do that, as the guictrlread needs to be told what to read,

 

the annoying thing is that two lines above i have it being used and works:

$ObjUser.Put ("sAMAccountName", GUICtrlRead($userbox))

$objUser.Put ("homeDirectory", GUICtrlRead($homebox))

$objUser.Put ("scriptPath", GUICtrlRead($logonbox))

 

its only the password one thats messing about

Posted

grrrrrrrrr, i dont think it was the actual function going wrong, it was my msgbox!

 

changed the msgbox to read MsgBox(0, "", "Password has been reset to " & GUICtrlRead($passbox) & @CRLF & "User will be asked to change password at next logon") and it worked. stupid thing!!!

  • 5 years later...
Posted
Hey MK-2 I know this is an old post but I was wondering if you has the full script and #includes for resetting a users password. Ive been playin with this for a while and still cant get it to work with partially my script and yours. I tried finding the functions as well and cant find those either.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...