Create a Local User Account with New-LocalUser

Add a new local Windows account (child, guest, shared machine) from PowerShell instead of the Settings wizard.

WindowspasswordsaccountspowershellLow risk
In an elevated PowerShell, capture a password with Read-Host -AsSecureString and run New-LocalUser -Name "username" -Password $pw to create the account.

01Command

Command
$ $pw = Read-Host "Password" -AsSecureString
New-LocalUser -Name "kid" -Password $pw -FullName "Kid Account" -AccountNeverExpires

02What it does

New accounts created this way land as standard (non-admin) users, which is exactly what you want for kids' profiles, a kiosk machine, or a houseguest. The -Password parameter demands a SecureString, so the two-step Read-Host pattern keeps the password out of shell history and logs. Add -AccountNeverExpires so the password does not expire out of the blue, and use Add-LocalGroupMember -Group "Administrators" only if the person genuinely needs admin rights. The account is fully removable with Remove-LocalUser when no longer needed.

03Risk

RiskLow risk
RequirementsPowerShell as Administrator
!Warning: Windows Home users created this way get no Microsoft-account sync (OneDrive, store purchases) — use Settings > Accounts if you want a linked Microsoft account instead.

04Undo

Undo
$ Remove-LocalUser -Name "kid"

05Sources

  • New-LocalUser
    Microsoft Learn · vendor-doc · 2026-09-17
    Evidence: Documents New-LocalUser with -Name, -Password (SecureString), -FullName, and -AccountNeverExpires parameters.

Last verified: 2026-09-18 · Category: System & Settings

06Related solutions