Add Lots of Users From text File

dougp23 used Ask the Experts™
At a school.  We have 1000 kids.  I want to take the kids and add them to the Windows 2000 server.  Is there a way to build a text file and have Win2K pull it in and assign each kid an account and home dir?


Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Here's a link to a script (VB) which will allow you to add users automatically:

Or, here's a batch file script that adds users.  The easiest way to use this would be to create your list of users in word, separate each user by putting them on a new line and put the command on each line.  This would look like:

addusr JohnM

If you already have a list of students, use Excel or Word to create usernames from their full names (usernames may not contain a space).  Once you have the full file of "addusr <username>" entries, name it addAllUsrs.bat and run it as a batch file on the cmd line.

NOTE: unless your domain controller is called DC2 you must change that line in the batch file below!

@echo off
::From the book Inside Active Directory,
::  ISBN 0-201-61621-1
::  Copyright (C) 2002 by Addison-Wesley
::  Script by Sakari Kouti (see
echo Adding a user
net user %1 /add
net user %1 /script:NETLOGON /homedir:\\dc1\%1

echo Adding a home folder
md d:\Users\%1

echo Granting permissions to the home folder
cacls d:\Users\%1 /g Administrators:F
cacls d:\Users\%1 /e /g %1:C

echo Sharing the home folder
net share %1=d:\Users\%1

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial