Jump to content

Search the Community

Showing results for tags 'local administrator'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. We changed security procedures and are changing the name of the local admin account on a computer. I created a script that changes the account, but only if the account is named "administrator". I need to change it to work with any administrator account name. Here is what I tried: #RequireAdmin #include<LocalAccount.au3> Global $OKMSGBOX = 1 $strComputer = "." ;This and the following two lines are newly added $CPU = ObjGet("WinNT://" & $strComputer & ",Computer") Local $sAdminAcct = $CPU.GetObject("User", "Administrator") Local $sUsername = InputBox('Password', 'New Admin Username: ', '', '*', -1, -1, 0, 0, 10000) MsgBox($OKMSGBOX, '', $sAdminAcct) ;for testing. Diplays a blank msgbox $boolrun = 1 While ($boolrun) $sPassword1 = InputBox('Password', 'New Admin Password: ', '', '*', -1, -1, 0, 0, 10000) $sPassword2 = InputBox('Password', 'Re-Enter New Admin Password: ', '', '*', -1, -1, 0, 0, 10000) If $sPassword1 == $sPassword2 Then _AccountSetPassword($sAdminAcct, $sPassword1, '0') _AccountRename($sAdminAcct, $sUsername, @ComputerName) $boolrun = 0 Else MsgBox($OKMSGBOX, '', 'The passwords you entered do not match.' & @CRLF _ & 'Please re-enter the desired admin credentials.') EndIf WEnd I added a few lines to assign the local admin account to the variable "$sAdminAcct" and then added the variable to the "_Account..." functions in place of "administrator". However, like it says above, the variable is blank. I enter all the credentials required, but it won't change the name. Any ideas how to get it to work?
×
×
  • Create New...