The Add Users utility (addusers.exe) is a command-line program that you can use to either dump the users on a system to a file or load users from a file to a system. Earlier resource kits included Add Users: You can see the program in the Books Online (BOL) documentation, which Microsoft hasn't updated for Windows 2000 (e.g., references to User Manager still exist).
Add Users is useful when you need to load a set of users or groups to several servers. For example, to automate the maintenance of your systems architecture in a Web farm, you need a way to update the local users on each system automatically. With Add Users, you can run the utility from a command prompt window, Windows Script Host (WSH), or batch file. As always with Windows NT 4.0 and now Win2K, you must log on with the correct security context to add or dump user information. If you don't have the correct rights to add users, the Add Users command will fail.
Adding Users and Groups
Add Users reads the data it uses from a simple ASCII text file. The file is a modified version of a Comma Separated Values (CSV) file. The format from BOL looks like this:
[User]
UserName,FullName,Password,_
Comment,HomeDriveAndPath,_
Profile,Script,
[Global]
GlobalGroupName,Comment,_
UserName, ...
[Local]
LocalGroupName,Comment,_
UserName, ...
The format of the input file and the syntax for Add Users look simple enough, but the proof is always in how things work. Here's an example. You can place the following text in a file named AddStandardUsers.txt:
[User]
joes,Joe Smith,joeno1,_
Programming administrator, _
c:\data\joes,,
suzyw, Suzy Wells, suzyw, _
Programmer, c:\data\suzyw,,
[Global]
[Local]
Programmers,Programmers,_
WebServer1\suzyw,
ProgrammingTeamLeader,_
Programming Team _
leader,WebServer1\joes
This .txt file adds two users and two groups, then adds the two users to the new groups.