how to create a local admin account from command prompt on win 11
aop3d techShare
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.
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:
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.
Example:
Using the user we created in the step above:
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:
Look for the "Local Group Memberships" section in the output. It should now list *Administrators.
Example: