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

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

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

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.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

621 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