Add and delete users and user groups in Windows cmd

Source: Internet
Author: User

Rem adds a user with the specified user name and password./expires: Never indicates that the Account will never expire;
Net user namePassword/Add/expires: Never

Rem deletes a user.
Net user username/delete

Rem deletes the user from the users group;
Net user admin_temp admintemp/Add/expires: Never

Rem adds the user to the specified group.
Net localgroup username/Add

 

Rem adds domain users to/from the Administrator Group

Net localgroup administrators app5173.com \ g_anquan/Add
Rem net localgroup administrators app5173.com \ g_anquan/delete

---------------------------------------------------------------------------------

If you need to specify the option when adding a user, refer to the following content:

Rem net user myuser/active: No disable myuser user
Rem net user myuser/active: Yes activating myuser user
Rem net user myuser/passwordchg: Yes user myuser Can Change Password
Rem net user myuser/passwordreq: Yes user myuser must have a password
Rem net user myuser/expires: Never user myuser never expires

Pause

Replace the aboveCodeSave it to the BAT file and run it!

 

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.