If you are unable to open Windows Settings panel and you want to create a new user account on your Windows 11 or Windows 10 computer, then this article will help you. You can create a Local User Account using PowerShell.
There are mainly two types of user accounts in Windows 11/10-
- Local User Account
- Microsoft Account connected User Account
It is not possible to create a Microsoft account connected user account with the help of Windows PowerShell but is very easy to create a local user account using PowerShell.
Before getting started, you should know that you can create a user account with or without a password, and the commands are different as they depend on your choice.
Create new Local User Account without password using PowerShell
To create a new local user account without any password using Windows PowerShell, open Windows PowerShell with administrator privilege. For that, press Win+X and select Windows PowerShell (Admin) from the list. After that, execute the following command-
New-LocalUser -Name "user-name" -Description "Small description" -NoPassword
Do not forget to replace the user-name with an actual username that you want. Also, replace Small description text with the matter that you want to show as a description.
After executing the command, as mentioned above, you will be able to set up your account and use it accordingly.
Create a new Local User Account with a password using PowerShell
Open the Windows PowerShell with administrator privilege. For that, you can follow the guide as mentioned earlier, or you can search for the “PowerShell” in the Taskbar search box and select the Run as Administrator option on your right-hand side.
After opening PowerShell, you need to create a password for your user account. To do so, enter this command-
$Password = Read-Host -AsSecureString
Now you need to type a password that you want. Make sure you have set a strong password.
After typing the password and hitting the Enter button, you need to enter this command-
New-LocalUser "TWCTEST2" -Password $Password -FullName "TWC Test Account" -Description "Small description”
Replace TWCTEST2 with your desired username, TWC Test Account with the full name of your user account, and Small description with brief info about your account.
After entering this command, you can find a screen like this-
That means your account is successfully created and ready to use. However, if you want to assign your account to a group, you can use the following command-
Add-LocalGroupMember -Group "Administrators" -Member "TWCTEST2"
Here are two things that you should know. First, if you’re going to add the new account to your Administrator group, you can keep it as is. Second, you have to replace TWCTEST2 with the username of your new user account.
How to delete User Account using PowerShell
To delete user account using Windows PowerShell, open the Windows PowerShell with administrator and enter this command-
Remove-LocalUser -Name "user-name"
Do not forget to replace the user-name with the original user name that you want to delete from your computer.
That’s it! I hope it will help you.