Create New Local Admin Account on the Fly

by Jan 24, 2014

Ever needed a new local administrator account for testing purposes? Provided you are already Administrator, and you opened a PowerShell with full Administrator privileges, adding such a user is a matter of just a couple of lines of code:

$user = 'splitpersonality'

net user /add $user
net localgroup Administrators /add $user

Note that the target group name is localized, so on non-US systems, you need to replace "Administrators" with the localized name of your Administrators group.

Twitter This Tip! ReTweet this Tip!