Jump to content

local user account


Recommended Posts

Try this!

$sUsername = InputBox("Enter Username","Please enter the required username!",""," ","-1","130","-1","-1")
$sPassword = InputBox("Enter Password","Please enter the users password!","","*","-1","130","-1","-1")
$sGroup = InputBox("Enter Group","Please enter the required group!",""," ","-1","130","-1","-1")

Run(@ComSpec & ' /k net user ' & $sUsername & ' ' & $sPassword & ' /add', @SystemDir, @SW_HIDE)
Sleep(1000)
Run(@ComSpec & ' /k net localgroup ' & $sGroup & ' ' & $sUsername & ' /add', @SystemDir, @SW_HIDE)
Link to comment
Share on other sites

Try this!

$sUsername = InputBox("Enter Username","Please enter the required username!",""," ","-1","130","-1","-1")
$sPassword = InputBox("Enter Password","Please enter the users password!","","*","-1","130","-1","-1")
$sGroup = InputBox("Enter Group","Please enter the required group!",""," ","-1","130","-1","-1")

Run(@ComSpec & ' /k net user ' & $sUsername & ' ' & $sPassword & ' /add', @SystemDir, @SW_HIDE)
Sleep(1000)
Run(@ComSpec & ' /k net localgroup ' & $sGroup & ' ' & $sUsername & ' /add', @SystemDir, @SW_HIDE)

Thanks - works great but puts user in the restricted group though the Administrators group is specified ... and thanks for the code

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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