NET user command Details (add users under DOS) _dos/bat

Source: Internet
Author: User
Tags net command
Net User

Add or modify user accounts or display user account information.

Grammar

NET user [UserName [Password | *] [options]] [/domain]

NET user [UserName {Password | *}/add [options] [/domain]]

NET user [UserName [/delete] [/domain]]

Parameters

UserName
Specifies the name of the user account to add, delete, modify, or view. The user account name can be up to 20 characters.
Password
Assign or change a password for a user account. Enter an asterisk (*) to produce a password prompt to type your password at the password prompt, without displaying the password.
/domain
Perform operations on the primary domain controller of the computer's primary domain.
Options
Specifies command line options. The following table lists the valid command-line options that you can use.

command-line option syntax
Description

/active:{no | yes}
Enable or disable user accounts. If the user account is inactive, the user cannot access resources on the computer. The default setting is Yes (that is, the active state).

/comment: "Text"
Provides a descriptive description of the user account. The annotation can have up to 48 characters. Enclose the text in quotation marks.

/countrycode:nnn
Use the operating system country/region code to implement the specified language files for user Help and error messages. A value of 0 represents the default country/region code.

/expires:{{mm/dd/yyyy | dd/mm/yyyy | mmm,dd, yyyy} | never}
Causes the user account to expire based on the specified date. The expiration date can be [mm/dd/yyyy], [dd/mm/yyyy], or [MMM,DD, yyyy] format. It depends on the country (region) code. Note that the account expires at the beginning of the specified date. For month values, you can use numbers, full names, or three-letter abbreviations (i.e., Feb, Mar, APR, May, June, April, Aug, Sep, Oct, Nov, Dec). For year values, you can use a two-digit or four-digit number. Use commas and slashes to separate parts of the date. Do not use spaces. If YYYY is omitted, the next occurrence (depending on the date and time of the computer) is assumed. For example, if you enter a date between January 10, 1994 and January 8, 1995, the following date items are equal:
jan,9
1/9/95
january,9,1995
1/9

/fullname: "Name"
Specifies the full name of the user rather than the user name. Enclose the name in quotation marks.

/homedir:path
Sets the path to the user's home directory. The path must exist.

/passwordchg:{yes | no}
Specifies whether the user can change his or her password. The default setting is yes.

/passwordreq:{yes | no}
Specifies whether the user account must have a password. The default setting is yes.

/profilepath:[path]
Sets the path to the user logon profile. This path points to the registry configuration file.

/scriptpath:path
Sets the path of the user logon script. Path cannot be an absolute path. Path is the relative path of the%systemroot%\system32\repl\import\scripts.

/times:{day[-day][,day[-day]], time[-time][,time[-time]] [; 匽 | all}
Specify when users can use the computer. The time increment is limited to 1 hours. For day values, you can use the full name or abbreviation (that is, M, T, W, Th, F, Sa, Su). You can use 12 hours or 24 hours of time notation. For 12-hour notation, use AM, PM, or a.m., p.m ... The all value indicates that the user can always log on. A null value (blank) means that the user will never be able to log on. Separate dates and times with commas, separating date and time units with semicolons (for example, m,4am-5pm; T,1PM-3PM). Do not use spaces when specifying time.

/usercomment: "Text"
Specifies that the administrator add or change the user annotation for the account. Enclose the text in quotation marks.

/workstations:{computername[,...] | *}
Lists up to 8 workstations that users can log on to the network. Separate multiple items in the list with commas. If/workstations does not have a list, or if the list is an asterisk *, the user can log on from any computer.

NET HELP command
Displays help for the specified net command.


Comments

If used without parameters, net user displays a list of user accounts on the computer. You can also type NET users.
The password must meet the minimum length requirements set in net Accounts/minpwlen. can be up to 127 characters. However, if you have computers running Windows 2000 or Windows XP that are on a network that is running Windows 95 or Windows 98, consider using a password that is no more than 14 characters. Windows 95 and Windows 98 support up to 14 characters of passwords. If your password is too long, you may not be able to log on to the network from those computers.


Example

To display a list of all user accounts on the local computer, type:
NET user
To view information about the user account Jimmyh, type:
NET user Jimmyh
To add a user account for the Jay Jamison, logon rights from 8 o'clock in the morning to 5 o'clock in the afternoon from Monday to Friday (no interval in time specified), and using the mandatory password (JAYJ) and full user name, type:
NET user jayj/add/passwordreq:yes/times:monday-friday,8am-5pm/fullname: "Jay Jamison"
To set the logon time for JOHNSW (8 o'clock in the morning to 5 o'clock in the afternoon) by using the 24-hour notation, type:
NET user johnsw/time:m-f,08:00-17:00
To set the logon time for JOHNSW (8 o'clock in the morning to 5 o'clock in the afternoon) by using the 12-hour notation, type:
NET user johnsw/time:m-f,8am-5pm
To specify MARYSL logon hours from 4 o'clock in the morning to 5 o'clock in the afternoon in Monday, 1 o'clock in the afternoon to 3 in Tuesday, and 8 o'clock in the morning to 5 o'clock in the afternoon from Wednesday to Friday, type:
NET user marysl/time:m,4am-5pm; t,1pm-3pm; w-f,8:00-17:00
XOX

Through net LOCALGROUP/ADD administrators ABC adds ABC to the Administrators user group, which enables the promotion of ordinary users to administrator users. For more information on cloud-dwelling communities.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.