How to move objects in AD using PowerShell scripts

Moving objects such as users, computers, and groups between containers in Active Directory (AD) helps maintain proper structure, delegation, and policy application. The following is a comparison between moving objects to different containers in AD using Windows PowerShell and ADManager Plus, a GUI-based AD management tool.

Windows PowerShell

Steps to move AD objects to different OUs in AD using PowerShell:

  • Identify the domain in which you want to move the objects(s)
  • Identify the LDAP attributes you need modify.
  • Compile the script.
  • Execute it in Windows PowerShell.

Sample Windows PowerShell script

 Copied
Move-ADObject -Identity "OU=ManagedGroups,DC=ABCCompany,DC=Com" -TargetPath "OU=Managed,DC=ABCCompany,DC=Com"
Click to copy entire script

ADManager Plus

To move AD users to another OU:

  • Select Move Users from User Management -> Management.
  • Select the target OU.
  • Choose the desired users from the domain and OU and click Apply.

Screenshot

» Start 30-day Free Trial

Following are the limitations to move AD user(s) using native tools like Windows PowerShell:

  • We can run this script only from the computers which has Active Directory Domain Services role.
  • With additional filters, the script will get longer and complicated.
  • Troubleshooting these scripts requires extensive AD and scripting expertise

ADManager Plus can help you move users in bulk to a different OU with just a CSV file in a simple and intuitively designed UI.

Move users to different OUs in bulk using a CSV file.

  Get 30-day free trial.
  • Embark on your script-free AD management, reporting, and automation journey with ADManager Plus.
  •  
  • By clicking 'Start your free trial now', you agree to processing of personal data according to the Privacy Policy.
  • Thanks
  • Your download should begin automatically in 15 seconds. If not, click here to download manually.

Related Powershell How-to Guides:

The one-stop solution toActive Directory Management and Reporting

Email Download Link Email the ADManager Plus download link