How can I create multiple users and groups using a script?

Posted on 2003-02-27
Medium Priority
Last Modified: 2010-08-05

I need to create multiple users/groups in a windows 2000 -environment, by using a script.

Is this possible with KIX?  If so, which commands do I have to use?

I don't find anything about it in the kix-manual...

Thanks in advance,

Question by:Stoffel69
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

Accepted Solution

siliconjunkie earned 100 total points
ID: 8035548
KIX probably isnt the best choice for this. Here is what I found at MS

Set objOU = GetObject("LDAP://OU=Management,dc=fabrikam,dc=com")
Set objUser = objOU.Create("User", "cn= AckermanPilar")
objUser.Put "sAMAccountName", "AckermanPila"

Set objOU = GetObject("LDAP://OU=Management,dc=fabrikam,dc=com")
Set objGroup = objOU.Create("Group", "cn=atl-users")
objGroup.Put "sAMAccountName", "atl-users"

objGroup.Add objUser.ADSPath

Or this, but it looks geared toward NT and web use http://www.swynk.com/winscript/SCRIPT_CreateDomainUser.asp

Dim Container
Dim ContainerName
Dim User
Dim NewUser
ContainerName = InputBox("Enter the Domain Name:")
Newuser = InputBox("Enter the new user name:")
Set Container = GetObject("WinNT://" & ContainerName)
Set User = Container.Create("User", NewUser)
LVL 14

Assisted Solution

by:Rob Miners
Rob Miners earned 100 total points
ID: 8038061
echo.     Modified By Rob Part 1 mkancil.bat
rem Create "Domain Staff" before running this script

net user %1 %2 /add /fullname:"%3 %4 %5 %6" /comment:"Staff user" /homedir:%LOGONSERVER%\%1$ /profilepath:%LOGONSERVER%\profiles$\Staff\%1 /scriptpath:Staff.bat

net group "Domain Staff" %1 /add /Domain

md %LOGONSERVER%\profiles$\Staff\%1

cacls %LOGONSERVER%\profiles$\Staff\%1 /T /G "Administrators":F %1:C <YES.TXT

md d:\users\home\Staff\%1

cacls d:\users\home\Staff\%1 /T /G "Administrators":F "Domain Staff":F %1:C <YES.TXT

net share %1$=d:\users\home\Staff\%1 /y

rem yes.txt is a text file that contains a y

     Part 2 staff.bat

call c:\mkancil.bat gwbou0 boutgr Bouttell Graham
call c:\mkancil.bat dehah0 hahnde Hahn Desma
call c:\mkancil.bat slhah0 hahnsh Hahn Sharon
call c:\mkancil.bat pehob0 hobdpe Hobdell Perry
call c:\mkancil.bat ljac0 jackly Jackson Lynette
call c:\mkancil.bat jjkam0 kamija Kaminski James
call c:\mkancil.bat tmce0 mcelta McElroy Tanya
call c:\mkancil.bat arpas0 pash01 Pashley Allan
call c:\mkancil.bat glpea0 peargl Pearce Glenys
call c:\mkancil.bat slphi0 philsh Phillips Sharyn
call c:\mkancil.bat bjpig0 pignbe Pignat Beverly
call c:\mkancil.bat arac0 rackal Rackemann Alan
call c:\mkancil.bat dmret0 rethdo Rethamel Doreen
call c:\mkancil.bat dkrus0 russdi Russell Diane
call c:\mkancil.bat jcsmi0 smitjo Smith John

Author Comment

ID: 8038440
Thanks a lot,



Expert Comment

ID: 9153350
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains the fundamentals of industrial networking which ultimately is the backbone network which is providing communications for process devices like robots and other not so interesting stuff.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Suggested Courses

752 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