powershell-commands-add-admin
This is an old revision of the document!
Table of Contents
Add a new admin user to Windows via Powershell
This script will prompt for a new password, store it as a secure string, then provision a new user with that password. It will also add the new user to the Administrators group.
Command
$Password = Read-Host -AsSecureString New-LocalUser "user_name" -Password $Password Add-LocalGroupMember -Group "Administrators" -Member "user_name"
Be sure to replace “user_name” with the actual values in lines 2 & 3.
Reference
powershell-commands-add-admin.1744914611.txt.gz · Last modified: by jsanders
