NET localgroup Commands (add users to the Administrators group, etc.) _dos/bat

Source: Internet
Author: User
Tags time limit
Copy Code code as follows:

NET User/add ABC *************/comment: "Description of this user"/expires:never
NET LOCALGROUP/ADD Administrators ABC adds ABC to the Administrators user group


NET localgroup

[GroupName [/comment: "Text"]] [/domain]
groupname {/add [/comment: "Text"] |/delete} [/domain]
GroupName name [...] {/add |/delete} [/domain]
NET localgroup is used to modify local groups on the computer. When you use this command without an option, it
Displays the local group on the computer.
GroupName refers to the name of the local group that needs to be added, expanded, or deleted. Just enter the group name
You can browse for a list of users or global groups in a local group.
/comment: "Text" adds a comment to a new or existing group. You need to enclose the text in quotation marks.
/domain performs operations on the primary domain controller of the current domain. Otherwise, on the local computer
Line this operation.
Name [...] lists one or more user names that need to be added or removed from a local group or
Group name. You can separate multiple user titles with an empty cells. The name can be a user
or global group, but cannot be a different local group. If a user is from another
Outside a domain, you should precede the user name with a domain name (for example, SALES\RALPHR).
/add adds a group name or a user name to a local group. Must be used for
This command adds a user or global group to the local group to establish an account.
/delete Deletes a group name or a user name from a local group.



NET USER
[Username [Password | *] [options]] [/domain]
Username {password | *}/add [options] [/domain]
username [/delete] [/domain]

NET user is used to create and modify users accounts on the computer. When you use this command without an option,
It lists the user accounts on the computer. The information for the user account is stored in the user accounts database.
This command runs only on the server.

Username refers to the name of the user account that needs to be added, deleted, modified, or browsed. The name of the user account cannot exceed 20 characters.
Password assign or change the password for a user account. Password must satisfy the Net ACCOUNTS command
The/minpwlen option specifies the minimum length required. It can have a maximum of 14 characters.
* Prompt to enter password. The password is not displayed when the user enters it at the password prompt.
/domain performs operations on the primary domain controller of the current domain.
/add adds a user account to the user accounts database.
/delete Deletes a user account from the user account database.

The Options are as follows:
Options description
--------------------------------------------------------------------
/active:{yes | NO} Activate or deactivate an account. If the account is inactive, the user
You cannot access the server. The default value for this option is yes.
/comment: "Text" provides a descriptive comment about the user account. You need to enclose text in quotation marks
/COUNTRYCODE:NNN uses the operating system's country/region code to implement user Help
and a specific language file for the error message. 0 indicates the default country/place
Area code.
/expires:{date | NEVER} If the date is set, it will cause the account to expire. Set Never,
There is no time limit on the account. According to the country/region code
Different, valid dates can be in the form of month/day/year or day/month/year.
The month can be a number, spelled full or three-letter abbreviation.
Year can be two-bit or four-digit digits. Use slash (/) (no spaces)
To separate the various parts of the date.
/fullname: "Name" is the full name (not the user name) of a user. Need to put a name
Enclose in quotation marks.
/homedir:pathname sets the path of the user's home directory. The path must already exist.
/passwordchg:{yes | NO} Specifies whether the user can change his or her password. The default value is yes.
/passwordreq:{yes | NO} Specifies whether the user's account must have a password. The default value is yes.
/profilepath[:p Ath] Sets the path for the user's logon profile.
/scriptpath:pathname refers to the location where the user's login file resides.
/times:{times | All} refers to the time that a user can log on. The Times is a way of expressing
Day[-day][,day[-day]],time[-time][,time[-time]],
The increment is limited to 1 hours. The day can be all spelled or abbreviated. Hours
Can be a 12-hour or 24-hour system. For a 12-hour system, you can
To use AM,PM. All indicates that the user can always log on. Empty Value table
Shows that users can never log on. You can use commas to separate day and time items.
Separate multiple days and time items with semicolons.
/usercomment: "Text" lets managers add or change user comments for accounts.
/workstations:{computername[,...] | *}
Lists the computers on which up to 8 users can log on to the network.
If/workstations does not have a list or list is *,
Users can log on from any computer.

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.