Thursday, September 11, 2025
HomeWindowsPowerShell Script to Create Local Administrator Account

PowerShell Script to Create Local Administrator Account

Local administrator accounts play a crucial role in system administration. They grant users elevated privileges to perform various tasks on a computer, such as installing software, modifying system settings, and troubleshooting issues.

If you ever had a need to create a local administrator account, use the below script in Command Prompt or PowerShell.

Open PowerShell or Command Prompt from Start.

Type the below script

###
net user newusername newpassword /add
net localgroup administrators newusername /add
###

Make sure to change the newusername and newpassword with desired username and password.

net user is a command-line tool that add , delete or modify user accounts and in the above code it creates an account with name “newusername” and password as “newpassword”.

net localgroup is a command-line tool that modifies the computer groups. In the above script the net localgroup adds the “newusername” to the local administrator group.

Baron S.
Baron S.https://www.oxusgeek.com
Baron is a passionate technology enthusiast. With more than a decade of experience in computer networking, cloud computing, and technical writing.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -

windows

mac

linux

tools