Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


August 2000

Automating the Addition of Users and Groups to a Server

RSS
Subscribe to Windows Web Solutions | See More Resource Kit Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

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.

   Previous  [1]  2  3  4  Next 


Reader Comments

You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
The Memory-Optimization Hoax

Don't believe the hype. At best, RAM optimizers have no effect. At worst, they seriously degrade performance. ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

WinInfo Short Takes: Week of November 24, 2008

An often irreverent look at some of the week's other news, including a Vista Capable dismissal request, Zune price reductions, Morrow musings, Novell and Microsoft sitting in a tree ... two years later, Yahoo!, IE 6 on Windows Mobile, and so much more ...


Related Events Delivering Reliable and Effective Web-Based Applications

Making Web Application Perform Better: What to Watch, How to Watch It, and How to Fix It

Check out our list of Free Email Newsletters!

IIS and Web Administration eBooks Keeping Your Business Safe from Attack: Monitoring and Managing Your Network Security

Related IIS and Web Administration Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing