+ Post New Thread
Results 1 to 5 of 5
Scripts Thread, AutoIT password change script not picking up password in Coding and Web Development; This is the script I have that shows users and then lets you input a password into a box and ...
  1. #1

    MK-2's Avatar
    Join Date
    Oct 2006
    Location
    Nottingham
    Posts
    3,237
    Thank Post
    149
    Thanked 581 Times in 307 Posts
    Blog Entries
    8
    Rep Power
    199

    AutoIT password change script not picking up password

    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':

    Code:
    $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!

  2. #2
    superfletch's Avatar
    Join Date
    Nov 2007
    Location
    South
    Posts
    434
    Thank Post
    146
    Thanked 77 Times in 61 Posts
    Rep Power
    31
    Bit of a guess here as I'm not great with AutoIt:


    Perhaps try

    $objUser.SetPassword (GUICtrlRead & ($passbox))

  3. #3

    MK-2's Avatar
    Join Date
    Oct 2006
    Location
    Nottingham
    Posts
    3,237
    Thank Post
    149
    Thanked 581 Times in 307 Posts
    Blog Entries
    8
    Rep Power
    199
    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

  4. #4

    MK-2's Avatar
    Join Date
    Oct 2006
    Location
    Nottingham
    Posts
    3,237
    Thank Post
    149
    Thanked 581 Times in 307 Posts
    Blog Entries
    8
    Rep Power
    199
    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. #5

    Join Date
    May 2014
    Posts
    1
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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.

SHARE:
+ Post New Thread

Similar Threads

  1. Change Password Permissions
    By Jamie_a in forum Windows
    Replies: 6
    Last Post: 17th December 2007, 03:20 PM
  2. REALVNC - Mass password change?!?
    By Ben_Stanton in forum Windows
    Replies: 3
    Last Post: 20th September 2007, 10:18 AM
  3. Icon to Link to Change Password
    By BKGarry in forum Windows
    Replies: 3
    Last Post: 11th August 2007, 09:45 PM
  4. Unable to change password
    By danIT in forum Mac
    Replies: 5
    Last Post: 11th January 2007, 04:00 PM
  5. Replies: 8
    Last Post: 12th November 2006, 02:02 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •