How to Instantly Create a Local Administrator Account in Windows


**Disclosure: This post contains affiliate links. If you make a purchase through these links, we may earn a small commission at no extra cost to you.

If you have ever installed Microsoft Windows on your computer or went through the initial configuration steps on a new computer, you know that Microsoft requires you to sign into Windows using a Microsoft Account. This is meant to provide a more connected and seamless experience across devices and services. When using a Microsoft account, you can synchronize settings, files, and apps between devices, access cloud services like OneDrive, and benefit from security features such as password recovery and multi-factor authentication. It also makes it easier to download apps from the Microsoft Store and integrate with tools like Microsoft 365 and Teams.

Many people still prefer to use a local account with Windows, either as a secondary account or as their main account. This allows for more privacy and doesn’t rely on using an account controlled by Microsoft to log in with. But adding a local administrator account in Windows can be a bit time consuming so in this article, we will be showing you how to instantly create a local account in Windows.

The process of instantly creating a local administrator account in Windows involves using PowerShell to run a script. You only need to edit a couple of sections of this script to customize it with your own username and password.  There are two different scripts you can try just in case one of them doesn’t work for you. You will also need to be sure to run PowerShell as an administrator, otherwise this will not work.

First Script

All you need to do is add the username in the $Name = “” section between the quotes such as $Name = “Bob”. Then you can add a password to the $Password = “” section such as $Password = “EG*&wlt1”

# new local Admin user

$Name = “”

$Password = “”

$SecureString = ConvertTo-SecureString -AsPlainText $Password -Force

$Description = “Administrator, Owner, Boss”

$Group = “Administrators”

$NewUserSplat = @{

    Name                     = $Name

    Password                 = $SecureString

    Description              = $Description

    AccountNeverExpires      = $true

    PasswordNeverExpires     = $true

    }

New-LocalUser u/NewUserSplat

Add-LocalGroupMember -Member $Name -Group $Group

#

 

Second Script

 Here you will want to add the username to the $UserName = “” line and the password to the $Password = “” line

 $UserName = “”

$Password = “”

$Description = “Administrator, Owner, Boss”

$Net = “Net.exe”

$User = “User”

$Add = “/Add”

$NeverExpires = “/Expires:Never”

$Comment = “/Comment:`”$Description`””

$Switches1 = @( $User, $UserName, $Password, $Add, $NeverExpires, $Comment )

& $Net @Switches1

#

$Localgroup = “Localgroup”

$Group = “Administrators”

$Switches2 = @( $Localgroup, $Group, $UserName, $Add )

& $Net @Switches2

#

Here is how the second script looks when run in PowerShell when adding a local administrator account named Bob with a password of Password.

How to Instantly Create a Local Administrator Account in Windows

Now when you click on Start and view your other configured user accounts, you should see the new local administrator account shown with your other accounts. Then you can click on it to log in with this new user.

How to Instantly Create a Local Administrator Account in Windows

For additional training resources, check out our online IT training courses.

Check out our extensive IT book series.

Related Posts

© 2025 Online Computer Tips
Website by Anvil Zephyr