NET USER options

The NET Command is used to manage user account settings as follows:

options are as follows:

NET USER... /active:{no | yes}
Enable or disable the user account.
The default is yes (login is allowed)
Disabling an account does not immediately log off any user sessions.

NET USER... /comment:"text"
A descriptive comment (48 characters).

NET USER... /countrycode:nnn
Use the OS country codes to implement specified language files for help and error messages. 0 = default country code.

NET USER... /expires:{date | never}
Cause the user account to expire. date can be in mm/dd/yy, dd/mm/yy, or mmm,dd,yy format, depending on the /countrycode. Months can be a number, spelled out, or abbreviated with three letters. Use commas or slashes to separate parts of the date (no spaces).

NET USER... /fullname:"name"
The user's full name (rather than a username).

NET USER... /homedir:path
The path for the user's home directory. The path must exist.

NET USER... /homedirreq:{yes | no}
Is a home directory required?

NET USER... /passwordchg:{yes | no}
Can users change their own password? The default is yes.

/passwordreq:{yes | no}
Must a user account have a password? The default is yes.

NET USER... /profilepath:[path]
The path for the user's logon profile.
This pathname will be used to store their registry profile.

NET USER... /scriptpath:path
Path for the user's logon script. This is relative to %systemroot%\SYSTEM32\REPL\IMPORT\SCRIPTS. (The NETLOGON share) You can’t use an absolute path.

NET USER... /times:{times | all}
The times the user is allowed to use the computer.
The times value is expressed as day[-day][,day[-day]] , time[-time][,time[-time]], limited to 1-hour time increments.
Days can be spelled out or abbreviated (M,T,W,Th,F,Sa,Su).
Hours can be 12- or 24-hour notation. For 12-hour notation, use AM, PM, or A.M., P.M.
The value all means a user can always log on.
A null value (blank) means a user can never log on.
Separate day and time with commas, and units of day and time with semicolons (for example, M,4AM-5PM;T,1PM-3PM).
Do not use spaces when designating /times.

NET USER... /usercomment:"text"
Add or change the "User comment" for the account. Only Administrators can edit this.

NET USER... /workstations:{computername[,...] | *}
List as many as eight workstations from which a user can log on to the network.
Separate multiple entries in the list with commas.
If /workstations has no list, or if the list is *, the user can log on from any computer.

Examples

NET USER jbloggs apass /ADD /fullname:"Joe Bloggs" /scriptpath:logon.cmd

NET USER alice_smith /ACTIVE:yes /comment:"RAS User" /DOMAIN

NET USER fred_bloggs /HOMEDIR:\\Server_05\ /PROFILEPATH:\\Server_05\D$\USERS\fred_bloggs /DOMAIN

”The only real way to look younger is not to be born so soon“ ~ Charles Schulz

Related commands

MODE - Configure a system device.
NETDOM - Domain Manager.
PRNMNGR - Add, delete, list printers and printer connections.
PsPasswd - Change account password.
SC - Service Control.
Q149427 - Change Password from the CMD prompt.
Equivalent bash command (Linux): usermod - Modify user account.


 
Copyright © 1999-2024 SS64.com
Some rights reserved