Skip to content

Instantly share code, notes, and snippets.

View thomasbiddle's full-sized avatar

TJ (Thomas J.) Biddle thomasbiddle

View GitHub Profile
@thomasbiddle
thomasbiddle / Create-Administrator.ps1
Last active December 28, 2017 23:42 — forked from ducas/Create-Administrator.ps1
Create a local administrator account using PowerShell
$Username = "su"
# Likely needs a capital letter, certain length and a number.
$Password = "TempPassword1"
$group = "Administrators"
$adsi = [ADSI]"WinNT://$env:COMPUTERNAME"
$existing = $adsi.Children | where {$_.SchemaClassName -eq 'user' -and $_.Name -eq $Username }