adamsj13 Posted December 5, 2005 Share Posted December 5, 2005 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 More sharing options...
Valuater Posted December 5, 2005 Share Posted December 5, 2005 maybe for a start $PID = Run(@ComSpec & " /C START " & "nusrmgr.cpl", "", @SW_MINIMIZE) Sleep(1000) Send("{tab}") Send("{DOWN}") Send("{ENTER}") 8) Link to comment Share on other sites More sharing options...
Gigglestick Posted December 5, 2005 Share Posted December 5, 2005 (edited) 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 December 5, 2005 by c0deWorm My UDFs: ExitCodes Link to comment Share on other sites More sharing options...
Greenseed Posted December 6, 2005 Share Posted December 6, 2005 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now