Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the command line syntax to create a windows local user and add that user to a local group?

Can I do it with something short and simple with net commands?

share|improve this question
up vote 11 down vote accepted

Something like:

net user username password /add

net localgroup groupname username /add
share|improve this answer
net group says "This command can be used only on a Windows Domain Controller" – Kyle Brandt Sep 27 '10 at 19:08
@Kyle: Sorry, typo. See edit. – Dennis Williamson Sep 27 '10 at 19:10
Ah, came back to fix, you fixed it for me :-) – Kyle Brandt Sep 27 '10 at 19:11
Well played, sir. Beat me to it... +1 to you – gWaldo Sep 27 '10 at 19:12
Add a /Y to answer yes to some prompts, e.g. complaints about the given password being too long for Win2k boxes – Michael Haren Feb 8 '13 at 20:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.