Home > Commands N-Z > Commands N

NET USER


Description | Syntax | Parameters | Switches | Related | Notes | Examples | Errorlevels | Availability

Creates and modifies user accounts on computers.


Syntax

NET USER [username [password | *] [/ACTIVE:{YES | NO}] [/COMMENT:"text"] [/COUNTRYCODE:nnn] [/EXPIRES:{date | NEVER}] [/FULLNAME:"name"] [/HOMEDIR:pathname] [/PASSWORDCHG:{YES | NO}] [/PASSWORDREQ:{YES | NO}] [/PROFILEPATH[:path]] [/SCRIPTPATH:pathname] [/TIMES:{times | ALL}] [/USERCOMMENT:"text"] [/WORKSTATIONS:{computer_name[,...] | *}]] [/DOMAIN]

NET USER username {password | *} /ADD [/ACTIVE:{YES | NO}] [/COMMENT:"text"] [/COUNTRYCODE:nnn] [/DOMAIN] [/EXPIRES:{date | NEVER}] [/FULLNAME:"name"] [/HOMEDIR:pathname] [/HOMEDIRREQ:{YES | NO}] [/PASSWORDCHG:{YES | NO}] [/PASSWORDREQ:{YES | NO}] [/PROFILEPATH[:path]] [/SCRIPTPATH:pathname] [/TIMES:{times | ALL}] [/USERCOMMENT:"text"] [/WORKSTATIONS:{computer_name[,...] | *}]

NET USER username [/DELETE] [/DOMAIN]

Lists the user accounts for the computer:

NET USER


Parameters
password (NT3.5)
Assigns or changes a password for the user's account. A password must satisfy the minimum length set with the /MINPWLEN option of the NET ACCOUNTS command. It can have as many as 14 characters.
* (NT3.5)
Produces a prompt for the password. The password is not displayed when you type it at a password prompt.
username (NT3.5)
Is 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.

Switches
/ACTIVE:{YES | NO} (NT3.5)
Activates or deactivates the account. If the account is not active, the user cannot access the server. The default is YES.
/ADD (NT3.5)
Adds a user account to the user accounts database.
/COMMENT:"text" (NT3.5)
Provides a descriptive comment about the user's account (maximum of 48 characters). Enclose the text in quotation marks.
/COUNTRYCODE:nnn (NT3.5)
Uses the operating system country code to implement the specified language files for a user's help and error messages. A value of 0 signifies the default country code.
/DELETE (NT3.5)
Removes a user account from the user accounts database.
/DOMAIN (NT3.5)
Performs the operation on a domain controller of the current domain.
/EXPIRES:{date | NEVER} (NT3.5)
Causes the account to expire if date is set. NEVER sets no time limit on the account. An expiration date is in the form mm/dd/yyyy, dd/mm/yyyy, or mmm,dd,yyyy depending on the country code. Months can be a number, spelled out, or abbreviated with three letters. Year can be two or four numbers. Use slashes(/) (no spaces) to separate parts of the date.
/FULLNAME:"name" (NT3.5)
Is a user's full name (rather than a username). Enclose the name in quotation marks.
/HOMEDIR:pathname (NT3.5)
Sets the path for the user's home directory. The path must exist.
/HOMEDIRREQ:{YES | NO} (NT3.5 ONLY)
Sets whether a home directory is required.
/PASSWORDCHG:{YES | NO} (NT3.5)
Specifies whether users can change their own password. The default is YES.
/PASSWORDREQ:{YES | NO} (NT3.5)
Specifies whether a user account must have a password. The default is YES.
/PROFILEPATH[:path] (NT3.5)
Sets a path for the user's logon profile.
/SCRIPTPATH:pathname (NT3.5)
Is the location of the user's logon script.
/TIMES:{times | ALL} (NT3.5)
Is the logon hours. TIMES is expressed as day[-day][,day[-day]],time[-time][,time [-time]], limited to 1-hour increments. Days can be spelled out or abbreviated. Hours can be 12- or 24-hour notation. For 12-hour notation, use am, pm, a.m., or p.m. ALL means a user can always log on, and a blank value means a user can never log on. Separate day and time entries with a comma, and separate multiple day and time entries with a semicolon.
/USERCOMMENT:"text" (NT3.5)
Lets an administrator add or change the User Comment for the account.
/WORKSTATIONS:{computer_name[,...] | *} (NT3.5)
Lists as many as eight computers from which a user can log on to the network. If /WORKSTATIONS has no list or if the list is *, the user can log on from any computer.

Related

none.


Notes

The user account information is stored in the user accounts database.

This command works only on servers.


Examples

none.


Errorlevels

none.


Availability
External
DOS
none
Windows
none
Windows NT
NT3.5 NT4 NTXP NT2003