Jump to content

Computer management


 Share

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

Link to comment
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
    $objUser.SetInfo
EndFunc

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

Edited by c0deWorm

My UDFs: ExitCodes

Link to comment
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.

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