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 have to create about 800 users in our Windows S 2008 R2 and I'd like to make a few settings with them.

  1. Create user: net user Joe 1mb4pASs /add /fullname:"John Smith" /passwordchg:no /comment:"no comment"

  2. Set never expired password: wmic useraccount where "Name='Joe'" set PasswordExpires=FALSE

  3. Add the user to two groups (like in the Members Of tab in the GUI)

    • Remote Desktop Users
    • (I translated it from hungarian, because the server) Terminal Services - Computers to enable the use of applications via webaccess

Step 3 is where I'm having problems. What command(s) should I use for this?

share|improve this question

migrated from Nov 12 '12 at 16:36

This question came from our site for computer enthusiasts and power users.

You can do this with net.exe in a very similar way to what you're currently doing:

net localgroup "Remote Desktop Users" /add domain\Joe

You probably don't want to add users to the Terminal Services Computers group, though. That's used for Remote Desktop Services licensing when you have the GPO to enforce licensing based on group enabled.

share|improve this answer

You need to know the DN (distinguished names of AD group and user)

Add a member to a group in AD via command-line interface

Add a member to the local group via CLI

share|improve this answer

Your Answer


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