• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 895
  • Last Modified:

Moving users in AD to different OU's and GROUPS

I want to move users in my AD into new OU and reasign then to new groups. So for example John Smith will currently be in OU 1 and is a member of GROUP 1 and GROUP 2, I want to move him to OU 2 and reasign him to GROUP 3 while removing him from GROUP 1 and GROUP 2.

I have a lot of users to move and don not want to do this one by one! Is there a way to set this up say using CSVDE or another command?
1 Solution
Depending on the specifics of what you're trying to do, you can use dsmove to move users into a new OU, and use dsmod for adding/removing members from a group.

For example:

dsmove "cn=jsmith,ou=marketing,dc=company,dc=com" -newparent "ou=training,dc=company,dc=com"

dsmod "cn=AccountingUsers,ou=marketing,dc=company,dc=com" -addmbr "cn=jsmith,ou=training,dc=company,dc=com"

Depending on the # of users that you need to move, you can also move multiple users simultaneously using AD Users & Computers - hold down the CTRL key while clicking on the users you want, then right-click and select "Move" to move all of them in a single operation.
In addition to the above statement you can highlight multiple users, right click and add them to groups as well.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now