Differences
This shows you the differences between two versions of the page.
|
powershell-commands-add-admin [2025/04/17 18:30] jsanders created |
powershell-commands-add-admin [2025/05/15 18:38] (current) jsanders [Command] |
||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ==== Command ==== | ==== Command ==== | ||
| + | $NewUser = Read-Host | ||
| $Password = Read-Host -AsSecureString | $Password = Read-Host -AsSecureString | ||
| - | New-LocalUser "user_name" -Password $Password | + | New-LocalUser $NewUser -Password $Password |
| - | Add-LocalGroupMember -Group "Administrators" -Member "user_name" | + | Add-LocalGroupMember -Group "Administrators" -Member $NewUser |
| - | //Be sure to replace "user_name" with the actual values in lines 2 & 3.// | + | |
| ==== Reference ==== | ==== Reference ==== | ||
| https://winaero.com/create-user-account-windows-10-powershell/ | https://winaero.com/create-user-account-windows-10-powershell/ | ||