The Net User command is a doscommand that must be run in MS-DOS mode under Windows XP, so first enter MS-DOS mode: Internal, to enter mode.
The following functions are based on this mode.
Create a common new user
Enter the following command in the MS-DOS prompt: "net user john 123/add", and press Enter. You can create a new user named "John" with a password of "123. The Add parameter indicates creating a user.
It is worth noting that the user name can contain a maximum of 20 characters, and the password can contain a maximum of 127 characters.
Create a user with limited Logon Time
Use the following methods to control the time used by the computer. For example, you need to create a John user account with the password "123". The logon permission ranges from AM to Am from Monday to Friday and am to AM.
1. In 12-hour mode, enter the following command: "net user john 123/add/times: Monday-Friday, 8AM-10PM; Saturday-Sunday, 7PM-9PM", and press enter to confirm.
2. In 24-hour mode, enter the following command: "net user john 123/add/times: M-F,-; Sa-Su,-", and press enter to confirm.
It is worth noting that the added value of Time is limited to 1 hour. For the Day value, you can use the full name or abbreviation (M, T, W, Th, F, Sa, Su ). It can be expressed in 12 hours or 24 hours. For 12-hour notation, use AM, PM, A. M., P. M .. The value of All indicates that the user can always log on. The value of null indicates that the user can never log on. Use commas to separate dates and time, and use semicolons to separate date and time units (for example, M, 4AM-5PM; T, 1PM-3PM ). Do not use spaces when specifying the time.
In addition, the Passwordchg: {yesno} parameter can be used to specify whether users can change their passwords. The default value is Yes.
Time Limit
The. Net User command can also use the Expires: {mm/dd/yyyy dd/mm/yyyy mmm, dd, yyyy} never} parameter to enable the User account to limit the expiration time of the specified Date. The expiration date can be in the format of [mm/dd/yyyy], [dd/mm/yyyy], or [mmm, dd, yyyy. It depends on the country code. The user account expires at the start of the specified date. For the month value, you can use numbers, full names, or abbreviations (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec ). For the year value, you can use two or four digits. Use commas and slashes to separate the parts of the date. Do not use spaces.