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

I have a multi-forest AD environment with trust relationships between domains in different forests. (AD level 2003)

I have a list of distinguishednames of users that I want to add to a local group in one of those domains.

How can I add a user to a group from the command line using the users DN? I can easily automate this with such a command and avoid having to do several hundred manual add commands though the GUI, but I can't find the command to use.

share|improve this question
up vote 2 down vote accepted

You can use dsmod group (

share|improve this answer

dsmod looks the simplest solution, but you can do it with a simple VBScript script. See for lots of examples.


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.