Solved

Create a User

Posted on 2003-11-19
5
302 Views
Last Modified: 2010-05-01
How do you create anew user on an xp or 2000 computer.
Can you assisgn them to a group
0
Comment
Question by:Eamon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 9

Accepted Solution

by:
TooKoolKris earned 100 total points
ID: 9780415
Use this ina (.vbs) file. Of course change the variables to your needs.

strComputer = "MyComputer"
Set colAccounts = GetObject("WinNT://" & strComputer & ",computer")
Set objUser = colAccounts.Create("user", "Admin2")
objUser.SetPassword "sA2xpWh"
objUser.SetInfo

0
 
LVL 9

Expert Comment

by:TooKoolKris
ID: 9780435
This one will add the user to a group as well.

strComputer = "MyComputer"
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group")
Set objUser = GetObject("WinNT://" & strComputer & "/kenmyer,user")
objGroup.Add(objUser.ADsPath)

0
 
LVL 1

Author Comment

by:Eamon
ID: 9786658
Perfect

Thank You TooKoolKris
0
 
LVL 9

Expert Comment

by:TooKoolKris
ID: 9787028
Your Welcome
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month6 days, 23 hours left to enroll

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question