Save 10%Pay yearly on any plan. 6% half-yearly, 3% quarterly. Help centreWhatsAppTelegram TeamsOpen a ticket

How to Create a User in Windows Server Through CMD

Create a local user on Windows Server with net user, give it Remote Desktop or administrator rights, set password rules, and disable or delete it again.

3 min readBy Daniel

Reviewed by the AmazingRDP technical team

Creating a user in Windows Server from the command prompt

Creating users needs administrator rights. An admin RDP gives you a Windows server where you are the administrator. See Admin RDP from $9.99

One command creates a user on Windows Server, and two more let that user sign in over Remote Desktop. This guide covers the commands you need, on Windows Server 2016, 2019, 2022 and 2025.

1. Open Command Prompt as administrator

Press Win + R, type cmd and press Ctrl + Shift + Enter. Without administrator rights every command below answers "Access is denied".

2. Create the user

net user alex * /add

The * makes Windows ask for the password and hide it while you type. You can also write the password in the command:

net user alex "S7r0ng-Passw0rd!" /add

That is shorter, but the password is then visible on the screen and in any script you save. Prefer the first form.

Two messages you may meet:

  • "The password does not meet the password policy requirements." Servers ask for a longer password with capitals, small letters, digits and symbols.
  • A question about Windows versions before Windows 2000. It appears when the password is longer than 14 characters. Answer Y.

3. Let the user sign in over Remote Desktop

A new user is a standard user and is not allowed to connect by Remote Desktop. Add it to the right group:

net localgroup "Remote Desktop Users" alex /add

Or, if the user should manage the server, make it an administrator (administrators may use Remote Desktop already):

net localgroup Administrators alex /add

Give administrator rights only to people who need them.

4. Check the result

net user
net user alex

The first command lists all users. The second shows one user's details: group memberships, last logon, and when the password expires.

Useful options

TaskCommand
Force a new password at first sign-innet user alex /logonpasswordchg:yes
Change the passwordnet user alex *
Add a full name and a notenet user alex /fullname:"Alex Kim" /comment:"Accounts team"
Disable the accountnet user alex /active:no
Enable it againnet user alex /active:yes
Set an end datenet user alex /expires:31/12/2027
Remove from a groupnet localgroup Administrators alex /delete
Delete the usernet user alex /delete

The date format of /expires follows the server's regional settings. Deleting a user does not delete its profile folder under C:\Users; remove that separately if you no longer need the files.

Password that never expires

net user has no switch for this. Use PowerShell (as administrator):

Set-LocalUser -Name alex -PasswordNeverExpires $true

The PowerShell way

PowerShell does the same job and suits scripts better:

$pw = Read-Host -AsSecureString "Password"
New-LocalUser -Name alex -Password $pw -FullName "Alex Kim"
Add-LocalGroupMember -Group "Remote Desktop Users" -Member alex

Several users at once

Put one net user line per person in a text file, save it with the ending .bat, and run it as administrator. Give each a temporary password and add /logonpasswordchg:yes so that everyone sets their own at first sign-in. Delete the file afterwards.

Local users and domain users

The commands above create local users on one server. On a domain controller, or with /domain added, net user creates the account in Active Directory.

Where this works

You need to be an administrator of the server: on an admin RDP, a Windows VPS or a dedicated server you are. On a shared RDP you are a standard user and cannot create accounts. Related guides: how to connect to RDP from a desktop, set the time zone with PowerShell and monitor all network traffic in Windows.

Questions

What is the command to create a user in Windows Server?

net user NAME * /add in a Command Prompt opened as administrator. Windows then asks for the password.

Why can the new user not connect by Remote Desktop?

A standard user is not allowed to. Run net localgroup "Remote Desktop Users" NAME /add.

Can I create a user without a password?

net user NAME /add does it where the password policy allows, but an account without a password should never be reachable over Remote Desktop.

How do I see the details of one user?

Run net user NAME. It shows groups, last logon and password dates.