Skip to content

Instantly share code, notes, and snippets.

@glombard
Created November 27, 2013 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glombard/7681414 to your computer and use it in GitHub Desktop.
Save glombard/7681414 to your computer and use it in GitHub Desktop.
Create a local user on Windows XP using PowerShell and add the user to the local Administrators group.
$computer = [ADSI]"WinNT://ie6winxp"
$u = $computer.Create("User", "test")
$u.SetPassword("test")
$u.put("description", "Test user")
$u.SetInfo()
$group = [ADSI]"WinNT://ie6winxp/Administrators,group"
$group.add("WinNT://ie6winxp/test")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment