Adds or modifies user accounts, or displays user account information.
Net user is a command-line tool that is built into Windows Vista. To run net user, open a command prompt, type net user with the appropriate parameters, and then press ENTER.
For examples of how this command can be used, see Examples.
Syntax
net user [<UserName> {<Password> | *} [<Options>]] [/domain] net user [<UserName> {<Password> | *} /add [<Options>] [/domain]] net user [<UserName> [/delete] [/domain]]
Parameters
Parameter | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<UserName> |
Specifies the name of the user account to add, delete, modify, or view. The name of the user account can have as many as 20 characters. |
||||||||||||||||||||||||||||
<Password> |
Assigns or changes a password for the user's account. Type an asterisk (*) to produce a prompt for the password. The password is not displayed when the user types it at the password prompt. |
||||||||||||||||||||||||||||
/domain |
Performs the operation on the domain controller in the computer's primary domain. |
||||||||||||||||||||||||||||
<Options> |
Specifies a command-line option. The following table lists valid command-line options that you can use.
|
||||||||||||||||||||||||||||
net help <Command> |
Displays help for the specified net command. |
Remarks
- When you use net user without parameters, it displays a
list of the user accounts on the computer. You can also type net
users.
- A password must satisfy the minimum password length value that
is set with the net accounts /minpwlen command. A password
can have as many as 127 characters.
Examples
The following example displays a list of all user accounts for the local computer:
net user
The following example displays information about the user account tommyh:
net user tommyh
The following example adds a user account for a user whose full name is Jay Jamison and whose user account name is jayj, with logon rights from 8 A.M. to 5 P.M., Monday through Friday (no spaces in time designations), a mandatory password (Cyk4^g3B), and the user's full name:
net user jayj Cyk4^g3B /add /passwordreq:yes /times:monday-friday,8am-5pm /fullname:"Jay Jamison"
The following example sets the logon time (8 A.M. to 5 P.M.) for miked by using 24-hour notation:
net user miked /time:M-F,08:00-17:00
The following example sets the logon time (8 A.M. to 5 P.M.) for miked by using 12-hour notation:
net user miked /time:M-F,8AM-5PM
The following example specifies logon hours of 4 A.M. until 5 P.M. on Monday, 1 P.M. until 3 P.M. on Tuesday, and 8 A.M. until 5 P.M. Wednesday through Friday for anibals:
net user anibals /time:M,4AM-5PM;T,1PM-3PM;W-F,8:00-17:00