Dear reader, this tutorial is based on PowerShell 5.1 and above, which is installed on Windows 10, Windows Server 2016 and higher by default. To use this command in earlier versions, you must add the linked module to PowerShell or use the commands Use Command Prompt to create a local account with powershell.
Whether you are managing a dedicated physical machine or setting up your remote windows VPS environment, learning how to effectively manage local user accounts through automation is a fundamental skill for any system administrator. Knowing these techniques helps streamline server provisioning and access control.
Making a Windows user with PowerShell

1. Open the PowerShell with Administrator access in Windows. You can learn the precise steps to elevate privileges by reading our guide on how to run PowerShell as administrator before starting.

2. To create the user in PowerShell, the New-local user command is used. The structure is similar to the one below.New-Local User -Name [username] [Option]
The New-Local User command structure is in the form of a main part called Name, which is actually the same as User name, and the other parameters that we will be explaining below.
Before explaining the various parameters, consider the following two examples to learn more about the structure of the user build command in PowerShell.
Example 1:
In the example below, a user is created with the name of Elizabet and no password is assigned to it, and in the Description section, an explanation is written for this user that can be customized to your liking.New-LocalUser -Name "Elizabet" -Description "Test User" -NoPassword

Example 2:
In the following example, as in the first example, a user named Elizabet and Description will be created and assigned to that password. A noteworthy point in this example is that PowerShell does not accept the password in the form of a simple text, or Clear text, and you must first create a variable and enter a password, and then use the variable in the commands. So, first enter the following command to create a variable named Password and get your password secretly.
Read: How to Choose a Strong Password?
$ password = Read-Host -AsSecureString
After entering the above command, you will receive a password that you can use after entering and pressing Inter.New-LocalUser -Name "Elizabet" -Description "Test User with Password" -Password $ password

This way, you will be able to build the user in a parachute. Now let's take a look at the description of other application parameters mentioned.
🚀 New-Local User command parameters in PowerShell
To fully utilize the cmdlet, system administrators should understand the available parameters that configure account states, passwords, and user details during creation.
Account Expires: User expiration date is specified with this parameter.
Account Never Expires: Specifies that the user account never expires, which is typical for service accounts or long-term operational users.
Disabled: User account is disabled or disabled upon creation.
Full Name: Full user name for organizational identification.
Password Never Expires: The user password does not expire.
User May Not Change Password: The user can change the password.
The following is one of the most important parameters of this command, which together with the parameters mentioned in the first and second examples, together constitute the application and specific parameters of this command. Now, in the next section, a complete example is made for the creation of an user whose application are shown below.
New-LocalUser -Name "elizabet" -Description "IT Manager" -Password $ password -FullName "Elizabet" -Disabled -PasswordNeverExpires -UserMayNotChangePassword
📊 Common PowerShell Management Commands
|
Command |
Description |
Usage Example |
|
New-LocalUser |
Creates a new local user |
New-LocalUser -Name "User1" -Password $pass |
|
Add-LocalGroupMember |
Adds a user to a local group |
Add-LocalGroupMember -Group "Administrators" -Member "User1" |
|
Get-LocalUser |
Lists local users |
Get-LocalUser |
|
Remove-LocalUser |
Deletes a local user |
Remove-LocalUser -Name "User1" |
Also if you need to add user to a local group in powershell follow this article.

You can access to your windows VPS hosting with powershell too, powershell provides you more secure connection to your server.
🔍 Comparison Table: Command Prompt vs. PowerShell
Understanding the differences between tools helps determine the right approach for your automation tasks.
| Feature | Command Prompt (net user) | PowerShell (New-LocalUser) |
|---|---|---|
| Syntax Style | Legacy command-line arguments | Object-oriented cmdlet syntax |
| Password Handling | Plain text in scripts (insecure) | SecureString variable support |
| Automation Capability | Moderate, script-based | High, integrated with complex scripts |
💡 Pro Tips for System Administration
- Always use the
-Passwordparameter with a secure variable to prevent credentials from being exposed in plain text. - Combine
New-LocalUserwith Management Windows Services with PowerShell to configure dedicated service accounts properly. - Regularly check system accounts using the
Get-LocalUsercommand to maintain security and compliance.
❌ Common Mistakes to Avoid
- Passing passwords as clear text: Using plain text directly within your commands poses a massive security risk to your server.
- Forgetting administrative rights: The New-LocalUser command requires elevation; forgetting to launch PowerShell as an administrator will result in permission errors.
- Mismatched data types: Ensure that the password variable is stored as a
SecureStringbefore supplying it to the cmdlet
One OF my major goals is getting new experiences about ICT and what’s more making progress through this field.