Page 1 of 1 1
Topic Options
#65447 - 2002-05-15 08:33 AM User Creation
Redback Offline
Getting the hang of it

Registered: 2002-03-20
Posts: 71
Loc: Albury Wodonga, Australia
Hi

I have created a kix script and a batch file to add new users

usercreator.kix
code:
? "Creating users from file " + $list

If open(1, $list) = 0
$x = Readline(1)
While @error = 0
shell "usercreator.bat " + $x + " password fullname c:\temp\" + $year + " server"
$x = Readline(1)
Loop

Endif

$list is a plain text file containing a list of users to be created and is defined at the command line

As you can see i have staticly defined values for the users fullname and password.

Can anyone sujest a better way to define the users that need to be created, so that i can pass multiple values to usercreator.bat??

Also any sujestions on other ways i might improve this code, or do this better in anyway, are more than welcome

usercreator.bat
code:
@ECHO OFF

Echo Creating User Account %1
NET USER %1 %2 /add

Echo Adding setting profile settings
NET USER %1 /scriptpath:LOGIN.BAT /passwordchg:yes /passwordreq:yes

Echo Adding Fullname: %3
NET USER %1 /fullname:%3 /comment:Student

Echo Adding To Students Group
NET GROUP STUDENTS %1 /ADD

Echo Creating Home Folder
MD %4\%1

Echo Sharing Folder
RMTSHARE \\%5\%1$=%4\%1 /grant %1:f users:5 /remark:%3

Echo Setting Permissions for Administrators
RMTSHARE \\%5\%1$ /grant administrators:f

Echo Removing 'Everyone' permissions
RMTSHARE \\%5\%1$ /remove everyone

Echo Adding Homedrive to profile
NET USER %1 /homedir:\\%5\%1$

variables list
%1 = username
%2 = password
%3 = full name
%4 = path on the server to the home shares
%5 = server name

The stuff in this batch file comes from what JackLothian posted in this thread

[ 15 May 2002, 08:34: Message edited by: Redback ]

Top
#65448 - 2002-05-15 02:14 PM Re: User Creation
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Redback,

What about ADDUSERS from the Resource Kit?

Here are some other variations of this:
Thanks,
- Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2630 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.055 seconds in which 0.029 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org