Home » PowerShell Tips » Net User Add Command – Creating Local Users using CMD Prompt

Net User Add Command – Creating Local Users using CMD Prompt

Net User command-line tool used to add or modify user accounts, and manage user groups in Windows. It offers a straightforward method for creating local user accounts.

The “net user add” command is a powerful tool for administrators to create new user accounts via a command-line tool. By specifying the username and optional parameters, you can generate local user accounts on the Windows systems.

net user create local user admin
Using the net user to create a local user admin

In this article, we will explore how to use the “net user add” command to create local users via the CMD prompt.

Net User Create Account with Password

To create a local user account with a password using the CMD prompt, follow these simple steps:

Open Command Prompt

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

Type the Net User command

net user syntax to add a new user with a password.

net user /add username password

Replace [username] with the desired username for the new user and [password] with the password you want to assign.

For example, to create a new user account with a password, run the following command in the cmd prompt and press enter.

net user /add adam ShellTest@123
The command completed successfully.

To create a local 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 /add” command-line tool, * after [username] prompts a user to type a password and retype the password for confirmation.

For 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 the workstation and the primary domain!

Using Net User Command to Show All Users

To display all users of a local computer system, use net user the command-line tool. It retrieves all the users and displays them on the console.

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!

Using Net User Command to Add Full Name of a User

To add a full name for a user account, use the below syntax.

net user username /fullname:"add full name"

In the above syntax, the net user command is used to manage a user account on a Windows computer.

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

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

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

Using Net User to Create Local Admin User

To create a local admin user or add an existing user to the local administrator group, use the “net localgroup /add” command.

net localgroup groupname user /add

use the net localgroup command to add a user to a specified groupname.

For example, to add user ‘adam‘ to the administrator group, run the below command.

net localgroup administrators adam /add
The command completed successfully.

In the above example, the net user adds a user to the administrator group.

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

Using Net User to Add Domain User to Local Group

To add a domain user to a local group of administrators, use the below net localgroup syntax.

net localgroup users domainname\username /add

For example, to add a domain user to a local group of administrators, run the below command.

net localgroup administrators SHELLPRO\adam /add

The above command adds a domain user named “SHELLPRO\adam” to the local administrator group.

To add a user to the remote desktop users group, run the below command.

net localgroup "Remote Desktop Users" Adam  /add

The above net command uses a localgroup parameter that adds user “Adam” to the “Remote Desktop Users” group using /add option.

To add a user to the Power Users group, run the below command.

net localgroup "Power Users" Adam /add

In the above script, the net localgroup command line tool adds user ‘Adam‘ to the “Power Users” group.

To display all local group administrators on a local computer system, run the below command.

net localgroup administrators

In the above net localgroup command the list of all users belonging to the administrators group.

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