If you use Windows 10, you are likely already utilizing an account connected to a Microsoft account. However, if you need to set up another account (in addition to using the Settings app and Command Prompt), you can create a new local user account using PowerShell. This guide will teach you the steps to create and delete a new local user account using PowerShell on Windows 10.

Create new local user account with PowerShell Delete new local user account with PowerShell

Create new local user account with PowerShell

Use the following steps to create a standard or administrator local account with PowerShell: Once you complete the steps, the new account will be set up on the device with full access using administrative privileges. Of course, this is unless you added the account to the “Users” group, in which case the account will be a limited standard account.

In the command, change NEW_ACCOUNT_NAME for the account name and USER_FULL_NAME for the user’s full name. Also, replace DESCRIPTION with the description you want to use for the account.

In the command, make sure to change NEW_ACCOUNT_NAME for the account name. In the above command, we add the new account to the Administrators group, which gives the user full access to the computer. However, if you want the user to have limited access, you can add the account to the Users group, making it a “Standard User.”

Connect new account to a Microsoft account

Using PowerShell should also be possible to create a user account connected to a Microsoft account with this command: New-LocalUser -Name “MicrosoftAccount[email protected]” -Description “Microsoft account description”. However, a bug still returns “New-LocalUser: Cannot validate argument on parameter ‘Name.’ The character length of the 36 arguments is too long. Shorten the character length of the argument so it is fewer than or equal to “20” characters, and then try the command again” message. As a result, the easiest way to get around this problem is to create a local account and then use the Settings app to link it with a Microsoft account. To link a local account with a Microsoft account, use these steps: After you complete the steps, the new account will be connected to the Microsoft account you specified.

Delete new local user account with PowerShell

Use the following steps to delete an account with PowerShell on Windows 10: After you complete the steps, the account will be deleted from the computer. However, the user account data will remain. If you want to delete both account and data, the easiest way is to delete it is using the “Accounts” page from the Settings app.

In the command, change USER_ACCOUNT_NAME with the account name you want to remove. All content on this site is provided with no warranties, express or implied. Use any information at your own risk. Always backup of your device and files before making any changes. Privacy policy info.