JoshN Posted May 7, 2004 Share Posted May 7, 2004 OK, needing a little bit o' help here. I'm wanting to create a vbscript that creates a local administrative user on an XP Pro computer already joined to an NT4 domain. The script prompts for the username that needs to be created. Here's what I have so far, from gleaning here and there: result1 = inputbox ("Please type the name of the new user", "user name",,800,800)strComputer = "."Set colAccounts = GetObject("WinNT://" & strComputer & ",computer")Set objUser = colAccounts.Create("Administrators", result1)objUser.SetPassword ""objUser.SetInfo I kinda figured this wouldn't run, but when run, I get "One or more arguments are invalid" error on line 4, character 1. I really don't need the password line, since the password is already set in the domain.Can anyone tell me what needs to happen here to get this to work? I'm not at all proficient at vbscripting, so take it easy one me.As a side question, when creating a new local user on a computer joined to a domain (in XP), it asks for a domain for that user. Would that need to be added to the script?EDIT: The user that will be added to the computer is a domain user that has already been created. Quote Link to comment Share on other sites More sharing options...
pc-tecky Posted May 9, 2004 Share Posted May 9, 2004 Hmm.. Pretty dumb on my part seeing how I don't use XP and I'm not very familar with vbscripting on the platforms, but doesn't Administrator already exist from the start when XP is installed? All of the versions that I have worked with appear to have it. Try [Ctrl] + [Alt] + [Del], Type Administrator for User Name. Unfortunately, you'll have to find out what the password really is from the person who set it up or try a blank password the first time around. Quote Link to comment Share on other sites More sharing options...
Ed_P Posted May 9, 2004 Share Posted May 9, 2004 Try [Ctrl] + [Alt] + [Del], Type Administrator for User Name.?? Where exactly do you type that? C+A+D brings up the Windows Task Manager on my XP system not the logon window. Quote Link to comment Share on other sites More sharing options...
JoshN Posted May 10, 2004 Author Share Posted May 10, 2004 Hmm.. Pretty dumb on my part seeing how I don't use XP and I'm not very familar with vbscripting on the platforms, but doesn't Administrator already exist from the start when XP is installed? All of the versions that I have worked with appear to have it. Try [Ctrl] + [Alt] + [Del], Type Administrator for User Name. Unfortunately, you'll have to find out what the password really is from the person who set it up or try a blank password the first time around.I am the person who sets these up and I know that there is already an Administrator account. I'm trying to create a user that already exists on the domain and add them to the local Administrators group. Quote Link to comment Share on other sites More sharing options...
Marsden11 Posted May 10, 2004 Share Posted May 10, 2004 strComputer = "MyComputer"Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group")Set objUser = GetObject("WinNT://" & strComputer & "/username,user")objGroup.Add(objUser.ADsPath) Quote Link to comment Share on other sites More sharing options...
Marsden11 Posted May 10, 2004 Share Posted May 10, 2004 Change the User PasswordSet objUser = GetObject _("LDAP://cn=username,ou=management,dc=fabrikam,dc=com")objUser.ChangePassword "i5A2sj*!", "jl3R86df" Quote Link to comment Share on other sites More sharing options...
JoshN Posted May 11, 2004 Author Share Posted May 11, 2004 Yes, but this isn't an AD domain, but an NT4 domain. Will that still work? Quote Link to comment Share on other sites More sharing options...
Marsden11 Posted May 11, 2004 Share Posted May 11, 2004 Can't say for sure. Been in AD domains for years... Quote Link to comment Share on other sites More sharing options...
JoshN Posted May 11, 2004 Author Share Posted May 11, 2004 Lucky you. Just tested and no go. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.