Solved

Copy users from one group to another in Active Directory

Posted on 2009-05-15
2
2,373 Views
Last Modified: 2012-06-27
I need to copy the the users in a group into another group.  I dont want to add the group itself because I am going to delete it.  This is in an exchange 2007 environment.  Thanks
0
Comment
Question by:TriCountyIT
2 Comments
 
LVL 5

Expert Comment

by:karstieman
ID: 24398531
You'll have to write a export script to export all users from the group.
There's no way to copy unless you copy the entire group you want to delete now and add this as member to your new group.
0
 
LVL 3

Accepted Solution

by:
PoorImpulseControl earned 500 total points
ID: 24398726
you can use the ds* commands to accomplish it fairly quickly.

Assuming you created the group "NewGroup" in the OU "MyUsers" in the AD domain MyAD.local, and you wanted to copy all the users from OldGroup into NewGroup (this is all one command):

dsquery group "CN=OldGroup,OU=MyUsers,DC=MyAD,DC=local" | dsget group -members | dsmod group "CN=NewGroup,OU=MyUsers,DC=MyAD,DC=local" -addmbr

A similar scenario is documented in the help for
dsmod group /?
where it shows adding all the users from an OU into a group.

0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question