+ Post New Thread
Results 1 to 4 of 4
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
    Blog Entries
    8
    Thank Post
    149
    Thanked 580 Times in 307 Posts
    Rep Power
    194

    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. IDG Tech News

  3. #2
    superfletch's Avatar
    Join Date
    Nov 2007
    Location
    South
    Posts
    386
    Thank Post
    130
    Thanked 71 Times in 56 Posts
    Rep Power
    26
    Bit of a guess here as I'm not great with AutoIt:


    Perhaps try

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

  4. #3

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

  5. #4

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

SHARE:
+ Post New Thread

Similar Threads

  1. Change Password Permissions
    By Jamie_a in forum Windows
    Replies: 6
    Last Post: 17th December 2007, 04: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, 05:00 PM
  5. Replies: 8
    Last Post: 12th November 2006, 03: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
  •