Jump to content

Recommended Posts

Posted (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    NextEndIf

It 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.

 

post-393927-0-65880400-1402509213.jpg

Edited by CNewell

Posted

Use wmic

 

wmic useraccount where "name='username'" set passwordchangeable=false

Is there any way to write that into AutoIT script?

Posted

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")

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...