Home » PowerShell Tips » Net User – Create Local User using CMD Prompt

Net User – Create Local User using CMD Prompt

Net User command-line tool used to add or modify user accounts, manage user groups in Windows. I will explain how to create local user account using the net user command-line tool using the cmd prompt on Windows computer.

net user create local user admin
net user create local user admin

In this article, I will explain using net user in cmd prompt to create local user account with a password in window computer.

Net User Create Account with Password

If you want to create local user account with a password from the command line, follow the below steps:

Open Command Prompt

Click Start –> Search cmd –> open Command Prompt with Run as Administrator

Type Net User command

net user syntax to add new user with password as below

net user /add username password

To add new user account with password, type the above net user syntax in the cmd prompt

net user /add adam [email protected]
The command completed successfully.

If you want to add new user account with a password but without displaying a password on the screen, use the below syntax

net user /add username *

In the above net user the command-line tool, * after username prompt for a user to type password and retype the password for confirmation.

Let’s see with below example,

net user /add nathan *
Type a password for the user:
Retype the password to confirm:
The command completed successfully.

Cool Tip: How to fix the trust relationship between workstation and primary domain!

Net User Show all Users

If you want to display all users of a local computer system, use net user the command-line tool to show all users as below

C:\Windows\system32>net user

User accounts for \\ENGG-PRO

-------------------------------------------------------------------------------
adam                     chrisd                   ErickJ
garyw                    Guest                    krbtgt
Tesadmin                 nathan                   toms
The command completed successfully.

Cool Tip: How to use Get-AdDomainController to get domain controller in PowerShell!

Net User Add Full Name

We have seen above to create new user in window computer using net user. If you want to add full name for a user account, use the below syntax

net user username /fullname:"add full name"

In the above syntax, net user command used to manage user account on windows computer.

/FullName – Use this net user switch to provide full name for user account

Run the below command to add user full name using net user /fullname

net user adam /fullname:"Adam Strauss"
The command completed successfully.

Net User Create Local Admin User

If you want to create a local admin user or add an existing user to the local administrator group, use the below syntax

net localgroup groupname user /add

use net localgroup to add user to specified groupname

For example, if you want to add user ‘adam’ created above to the administrator group, run the below command

net localgroup administrators adam /add
The command completed successfully.

In the above example, net user add user to the administrator group.

Cool Tip: How to find active directory groups I m in using PowerShell!

Net User to Add Domain User to Local Group

If you have a requirement to add a domain user to local group of administrators, use below net user syntax

net localgroup users domainname\username /add

For example, if you have a computer connected to a network system and have a requirement to add domain user to local group of administrators, run the below command

net localgroup administrators SHELLPRO\adam /add

the above command will add a domain user to local administrator group.

If you want to add a user to the remote desktop users group, run the below command

net localgroup "Remote Desktop Users" adam  /add

above net user the command will add user adam to the “Remote Desktop Users” group using /add option.

If you want to add a user to the Power Users group, run the below command

net localgroup "Power Users" adam /add

above the net user command will add user ‘adam’ to the “Power Users” group.

If you want to display all local group administrators on a local computer system, run the below command

net localgroup administrators

above net user administrators command will display the list of all users belonging to the administrator group as below

C:\Windows\system32>net localgroup administrators
Alias name     administrators
Comment        Administrators have complete and unrestricted access to the computer/domain

Members

-------------------------------------------------------------------------------
adam
Domain Admins
Enterprise Admins
admin
The command completed successfully.

Cool Tip: How to get-aduser in the active directory using PowerShell!

Conclusion

In the above article using a net user to create a new user account with a password, the net user adds the full name of the user account and manages user accounts on the local computer.

Cool Tip: How to command prompt restart the windows using cmd!

You can find more topics about PowerShell Active Directory commands and PowerShell basics on the ShellGeek home page.

Leave a Comment