Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

I need to create a number of local accounts on Windows Server 2003. Previously I have created them using the 'Computer Management' gui screen but that method is very tedious and slow.

Is there a command-line method to create a local user (not active directory)?

Ideally the command-line method would create username, password from a CSV file.


Creating a user from the command-line.

net user myUserName /random /add /comment:"9.13.2011" /expires:never /fullname:"My User Name" /passwordchg:no

Adding that user to 'Remote Desktop Users' group:

net localgroup "Remote Desktop Users" myUserName /add
share|improve this question
up vote 2 down vote accepted

To expand on Sergey's comment:

The Net command in NT can provide complete local user and group management. You'll need to work with syntax and your intentions, primarily:

  • net accounts
  • net user
  • net localgroup

Sergey's link is good, but these examples may give you more options.

share|improve this answer

You can use net user command to create users (local or domain) from command line

share|improve this answer

There are any number of ways. CSVDE or LDIFDE will import users from a CSV or LDIF file. However, "You cannot import user passwords by using csvde"

share|improve this answer

I would highly recommend investigating powershell 2 for something like this. It goes one step beyond the command-line... it helps you AUTOMATE tedious command-lines. It has powerful utilities that include quick imports of CSV files, and then performing actions on the objects and data contained within that CSV file.

The following is pseudo-code of how it can act:


where SOME-CREATE-USER-COMMAND is whatever command you want to use to create users. It is called once for each entry in the CSV file. It has access to the data in the CSV file, and can create users, or run any commands for that matter, making use of fields in the CSV file. This is extremely useful for when you have enough entries that manually typing command-lines becomes tedious and error-prone.

And this is coming from a UNIX guy that just learned PS 2 two weeks ago. I gotta' say - PS2 (powershell 2) is pretty sweet. I think you'll like it for automating tasks such as this.

share|improve this answer

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.