CNewell Posted June 11, 2014 Share 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 Link to comment Share on other sites More sharing options...
CNewell Posted June 12, 2014 Author Share Posted June 12, 2014 Anyone? Link to comment Share on other sites More sharing options...
Tripredacus Posted June 12, 2014 Share Posted June 12, 2014 Use wmic wmic useraccount where "name='username'" set passwordchangeable=false Link to comment Share on other sites More sharing options...
CNewell Posted June 12, 2014 Author Share Posted June 12, 2014 Use wmic wmic useraccount where "name='username'" set passwordchangeable=falseIs there any way to write that into AutoIT script? Link to comment Share on other sites More sharing options...
Tripredacus Posted June 12, 2014 Share 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") Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now