Creating a local user account in Windows 10
The option to create a local user account is no longer available in the Control Panel as it has been moved to the Settings App. The workflow for this task is a bit convoluted since the Settings app gives more prominence to Microsoft accounts.
Create a user account using the Settings App
Open the settings app and click Accounts
Click family & other people
Add someone else to this PC
I don’t have this person’s sign-in information
Add a user without a Microsoft account
Add user account details and click next
Here is a video showing all the steps
Create a local user account using PowerShell
You can use the PowerShell cmdlet New-LocalUser to create a local user account. The following code snippet shows some sample commands.
1# Read password , this is to avoid having to type password on the commandline
2$Password = Read-Host -AsSecureString
3# Create a local user account
4New-LocalUser "User1" -Password $Password -FullName "User1" -Description "Test Account"
5# Add account to Users group
6Add-LocalGroupMember -Group "Users" -Member "User1"
7# Add account to Administrators group
8Add-LocalGroupMember -Group "Administrators" -Member "User1"
9# View all members of a local group
10Get-LocalGroupMember "Users"
11# remove user from a local group
12Remove-LocalGroupMember -Group "Administrators" -Member "User1"
13# delete local user account
14Remove-LocalUser -name "User1"
In the above snippet, the password is first read as a secure string. The password typed by the user will not be echoed to the screen. Reading the password first is necessary here since PowerShell console remembers command history. The New-LocalUser cmdlet creates a new user but does not add the user to any group. This means that at this stage the new account will not appear in the login screen or in the Settings App. So the Add-LocalGroupMember cmdlet is needed to make the user account practically useful.
Typically, you would want to make the new user a member of the Users group or the Administrators group. This corresponds to Standard User and Administrator in Windows GUI. If you wish to see the other groups available on your computer run lusrmgr.msc. The remaining commands are optional, you might find them useful when working with User accounts using PowerShell.