How to Create a new User Account in Windows 10 with PowerShell

Windows 10 allows you to create a new user account where you can get additional benefits like effortless integration to different Microsoft cloud services, syncing across devices, and others. In order to get these benefits, you need to set up a new user account.

The good thing is that you can create a new users account With PowerShell on Windows 10. Here in this article, we will show you the way to create a new user account with PowerShell on Windows 10.

Create a new user account with PowerShell on Windows 10

In order to create a new user account, create a local account first and then connect it with Microsoft account. Follow the below instructions to set up a new user account using PowerShell.

  • Right-click on the Windows icon and choose Windows PowerShell (Admin) from the menu.
  • Confirm Yes when UAC prompts.
  • In the PowerShell window, type the command given below to temporarily store the password inside the $Password variable and hit Enter.
$Password = Read-Host -AsSecureString
  • Now type the password you want and hit Enter.
  • In the elevated window, type the command given below to create the new account and hit enter.

New-LocalUser "NEW_ACCOUNT_NAME" -Password $Password -FullName "USER_FULL_NAME" -Description "Description of this account."

Note: Substitute the NEW_ACCOUNT_NAME with the user name and USER_FULL_NAME with the full user name.

  • Type the command given below to create an Administrator account and Hit Enter.
Add-LocalGroupMember -Group "Administrators" -Member "NEW_ACCOUNT_NAME"

Note: Substitute the NEW_ACCOUNT_NAME with the users’ name. This command is for creating an Administrator account. It allows the new user to have full access to the device. In the case when you want to provide limited access to the new users, substitute the Administrators group with the Users group. This will create Local user accounts.

Connect a new account to a Microsoft account

PowerShell also provides you the feature to create a new user account connected with Microsoft account. But often you face a bug that prevents you from creating such an account.

So here we present you the steps to connect your new user account with Microsoft account:

How to Create a new User Account in Windows 10 with PowerShell

  • Sign-in the system using the new user account.
  • Press the Windows + I to open the Settings.
  • Choose Accounts.
  • In the left pane, click on Your info.
  • Now select the Sign in with your Microsoft account instead option.
  • Follow the on-Screen instructions to connect your newly created account to a Microsoft account.

The above steps will connect your newly created account with your Microsoft account.

How to delete a new local user account with Powershell

If you don’t need the created account anymore, you can delete it using Windows PowerShell. Following are the steps to do so:

  • Open PowerShell with administrator access as mentioned above.
  • In the elevated window, type the command given below and hit enter.
Remove-LocalUser -Name "USER_ACCOUNT_NAME"

Note: Don’t forget to substitute the USER_ACCOUNT_NAME with the new account name. In the case when you use the wrong name, the system will delete the incorrect account.

Once you complete the above steps, the new user account will be deleted from your system.