Net User command can be used to create, remove, enable or disable user account, delete or modify user account on a computer or in a domain and reset Windows password on computer, which applies to Windows server 2016/ 2012(R2)/ 2008(R2)/ 2003(R2)/2000 and Windows client operational systems. To Use Net User Command for Windows Server 2016, 2012 R2, 2012 You should read this article step by step
Use Net User Command for Windows Server 2016
Now based on net user command introduction above, make some changes on command for server 2012 2016 domain controller in purpose of: shown in figure.
- add user account to local users
- Create/add domain user
- Change/reset a domain user password
- Delete/remove domain user
- Disable/enable a domain user
1. Create New User Using Net User Command
In this method i will going to show you how to create/ add a new user account using net user command line. So, now if you want to create new user account on windows server 2016 with net user command line, follow this method. creating a new user account.
Step 1: To run this command, open a command prompt (Win+R) to open Run and type cmd then press enter. and then type the following command.
net user [username [password|*] /add
Example: net user niaz abc!123 /add
when the command completed successfully, type “net user” command and press enter, you would find new user account “niaz” has been created as local user.
2. Create or add domain User with net user command
/domain = This switch forces net user to execute on the current domain controller instead of the local computer. To create domain with net user command, follow me.
We have two options to create a user account. We can either provide the user account password in the command itself or can have separate prompt to enter the password. The command to create a user account is:
- NET USER <User ID> <Password> /ADD [/DOMAIN] [OPTIONS]
- NET USER <User ID> * /ADD [/DOMAIN] [OPTIONS]
Example: net user niaz abc!123 /add /domain
If you have interest in other ways to create user account in Windows server 2016, please go to read this:
How to Add User Account to local Administrator Group in Server 2016
3. Change or reset domain user password with command
If you’re administering a computer and need to access another user’s account, you can use the “net user” command to change their password. If you are locked out of your computer, or don’t have administrator access, you can use a Windows installation disc to access the net user command and change any user’s password.
net user [username [password|*] /domain [OPTIONS]
Example: net user nyaz !abc123 /domain
4. Delete/remove domain user with net user command
When I’m out on the floor and someone tells me their windows account is deactivate, it bothers me when I have to walk all the way back to my desk to active that user. Instead I can log into any free box on the floor go to the command line to check if the users account is delete/remove and then if it is you can unlock it right from there and also change their password from there.
net user [username] /delete /domain
Example: net user Ahmad /delete /domain
then you should be all set. but keep in mind you must be logged in as a domain admin to do this or use the Run as command which i have a link in the references on how to use.
5. Disable/enable a domain user with following command
- Disable domain user: net user [username] /active: no /domain Example: net user nyaz /active: no /domain
- Enable a domain user: net user [username] /activate: yes /domain Example: net user nyaz /active: yes /domain
Before you disable domain user, when you type command “net user ahmad”, you would see this. ( refer in the screenshot below)
After you run command “net user ahmad /active: no /domain”, and hen type “net user ahmad” and press Enter, you would see this user is disabled.
Above introduced commands are usually used in computer, and easy for even computer novice. But if you want to try other more complicated command, powerful technology is needed considering computer safety.
For more information:
- Net User command for administrators in Windows
- Manage user accounts with NET USER command
- Net User Command add, delete, User Account
Hope you find it helpful and do it like a IT experts. If you have any problem or question about the articles, Feel free to comment, rate, or tell me what I did wrong so I can correct it. Also, if someone has an idea for another instructable, please tell me.