CNewell Posted June 11, 2014 Posted June 11, 2014 (edited) So far, I have this script AUTOIT; ENABLE ADMIN ACCOUNT$strComputer = @ComputerName$user = @UserNameLocal $colUsers, $sTmp, $Array[1] = ["user"]$colUsers = ObjGet("WinNT://" & @ComputerName)If IsObj($colUsers) Then $colUsers.Filter = $Array For $objUser In $colUsers if $objUser.Name = "Administrator" Then ;Account disabled? If $objUser.AccountDisabled Then $objUser.AccountDisabled = False EndIf $objUser.SetPassword("PASSWORD") $objUser.setInfo EndIf NextEndIfIt works for how it is setup (thank you to whomever created it, I can't take credit.). It enables and sets the password. However, I want to be able to check the attribute found in the properties so that Users cannot change the password for it. Edited June 11, 2014 by CNewell
Tripredacus Posted June 12, 2014 Posted June 12, 2014 Use wmic wmic useraccount where "name='username'" set passwordchangeable=false
CNewell Posted June 12, 2014 Author Posted June 12, 2014 Use wmic wmic useraccount where "name='username'" set passwordchangeable=falseIs there any way to write that into AutoIT script?
Tripredacus Posted June 12, 2014 Posted June 12, 2014 I primarily run all my wmic commands in a .cmd. You can try this, I didn't test it out, just edited for syntax highlighting. RunWait (@ComSpec & " /c wmic useraccount where " & Chr(34) & "name='username'" & Chr(34) & " set passwordchangeable=false")
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now