Controlling user accounts from the command line

As a network administrator, you spend a lot of time managing user accounts on your network. Microsoft provides some nice GUI tools in Windows NT and Windows 2000 to help you administer your users; however, sometimes these things can be done more efficiently from the command line. In this Daily Feature, I'll show you how you can administer user accounts from the command line using the Net User command.

Your wish is my command
Let's face it, GUIs are designed to be easy to use, not necessarily to be efficient. How do you access a user account in Windows NT? Click Start. Click Programs. Click Administrative Tools (Common). Click User Manager For Domains. Click the user. If you want to do anything to the user, keep clicking. Click. Double-click. Right-click. Left-click. Click, click, click. Almost as much clicking as a tap dancer putting on a show. And Windows 2000 isn't much better.

Fortunately, you can save your clicking finger by taking a quick trip to the command line. That's only two clicks. Click Start. Click Run. Type cmd and press [Enter].

At the command line you can use one simple command—Net User. The Net User command can do almost all of the same things to users that you can do using the User Manager For Domains in Windows NT or Users And Computers in Windows 2000. Net User works the same way on both Windows NT and Windows 2000.

Casting your net
Although any user can use the Net User command, the user must have Administrator rights in order to do anything to anyone else using the command. Therefore, before you drop to the command prompt to use the command, make sure you're logged on as Administrator or as a user with Administrator rights.

When you launch the command prompt, type net user and press [Enter]. When you do, you'll see all of the users on the network.

If you want to view detailed information about an individual user, type net user username and press [Enter]. Just replace username with the name of the user you want information on. When you do, you'll see a listing on the screen like this:

User name jsheesley
Full Name John Sheesley
Comment
User's comment
Country code 000 (System Default)
Account active Yes
Account expires Never

Password last set 12/19/2000 4:18 PM
Password expires 3/31/2001 3:05 PM
Password changeable 12/19/2000 4:18 PM
Password required Yes
User may change password Yes

Workstations allowed All
Logon script
User profile
Home directory
Last logon 2/13/2001 11:41 AM

Logon hours allowed All

Local Group Memberships *Administrators *Users
Global Group Memberships *None
The command completed successfully.


Net User includes other command line switches you can use to affect user accounts on your network. When you enter the command in conjunction with the switches, make sure you specify the username you want to affect. To view all of the switches, type net help user and press [Enter]. These switches include: