how to create a local admin account from command prompt on win 11

how to create a local admin account from command prompt on win 11

aop3d tech
Windows 11 Guide

Create a Local Admin Account via Command Prompt

You can create a local admin account in Windows 11 using two simple commands. Here is the step-by-step process.

Preparation: Open Command Prompt as Administrator

Before executing any commands, you must open the Command Prompt with elevated privileges.

  • Click the Start button or press the Windows key.
  • Type cmd.
  • In the search results, right-click on Command Prompt and select Run as administrator.
  • Click Yes at the User Account Control (UAC) prompt.

Step 1: Create the New Local User

In the administrator Command Prompt window, type the following command, replacing <Username> and <Password> with your desired credentials.

net user <Username> <Password> /add

Important Notes:

  • If your desired username or password contains spaces, you must enclose it in quotes (e.g., net user "John Doe" "My Password 123" /add).
  • Your password must meet the system's password complexity requirements (if any are set).

Example:
To create a user named NewAdmin with the password Pa$$w0rd123!, you would type:

net user NewAdmin Pa$$w0rd123! /add

Press Enter. If successful, you will see "The command completed successfully."


Step 2: Add the User to the Administrators Group

Now that the account exists, you need to grant it administrator rights. Type the following command, replacing <Username> with the same username you just created.

net localgroup Administrators <Username> /add

Example:
Using the user we created in the step above:

net localgroup Administrators NewAdmin /add

Press Enter. You should again see "The command completed successfully."


(Optional) Step 3: Verify the Account

You can verify that the user is now in the Administrators group by typing:

net user <Username>

Look for the "Local Group Memberships" section in the output. It should now list *Administrators.

Example:

net user NewAdmin
The new account will now be available on the Windows 11 sign-in screen with full administrator privileges.
Back to blog

Leave a comment

Please note, comments need to be approved before they are published.