Jump to content
Sign in to follow this  

Computer management

Recommended Posts


Hi All,

I'm wanted to wright a script that will add a userID as a administrator on a WINXP box. Is there a easy way to create a script? When I enter in the user id I want, I also have to enter in my ID and Password. I would like to have this coded in the script. Can anyone help me? Thanks

Share this post

Link to post
Share on other sites

maybe for a start

$PID = Run(@ComSpec & " /C START " & "nusrmgr.cpl", "", @SW_MINIMIZE)



Share this post

Link to post
Share on other sites

I got this from www.activexperts.com and converted it. Not tested, but it should get you started.

Func _CreateLocalUser($strComputer, $strUsername, $strPassword)
    $colAccounts = GetObject("WinNT://" & strComputer & "")
    Set $objUser = $colAccounts.Create("user", strUsername)
    $objUser.SetPassword $strPassword

*EDIT* Look here for Active Directory example scripts or look here for Local Computer and NT4 example scripts

Edited by c0deWorm

My UDFs: ExitCodes

Share this post

Link to post
Share on other sites

look at this command in dos:

net user greenseed dexxa /add

net localgroup Administrators greenseed /add

net accounts /maxpwage:unlimited

create a user called greenseed with password dexxa

then add greenseed to the local administrators group

and finaly set the password maximun age to unlimited for everyuser

this is a little batch file i have on my automated OEM windows Install

it work pretty well

it very easy to implement to autoit and make a GUI or simply inputbox! and type NET HELP USER for more information or NET HELP localgroup and ... and simply net help for all available command!

it can work on ActiveDirectory domain and NT4 domain.

hope this help!

bye bye!

GreenseedMCSE+I, CCNA, A+Canada, QuebecMake Love Around You.

Share this post

Link to post
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
Sign in to follow this