Support
 
Phone Live Chat
 
Support
 
US: +1 888 720 9500
 
Intl: +1 925 924 9500
Aus: +1 800 631 268
UK: 0800 028 6590
CN: +86 400 660 8680

Direct Inward Dialing: +1 408 916 9393

 
 
 
 
 

How to move AD computers

Moving a computer account to a different organizational unit (OU) changes which Group Policy settings and delegated permissions apply to it. This is why it's a routine part of reorganizing a domain, onboarding machines from the default Computers container, or staging devices during imaging. This guide covers moving computer accounts using three methods: the Move-ADObject cmdlet in PowerShell, the Active Directory Users and Computers (ADUC) console, and ManageEngine ADManager Plus.

 
  • PowerShell
  • ADUC
  • ADManager Plus
  • Troubleshooting
  • Why ADManager Plus
  • Real-world use cases
  • FAQ
 

How to move AD computers using PowerShell

Prerequisites

  • Permissions: Your account must have rights to move computer objects, provided to members in the Account Operators or Domain Admins groups, or to remove the computer object from its source container and create it in the destination container.
  • Tools: The Move-ADObject and Get-ADComputer cmdlets come with the Active Directory module for Windows PowerShell, which is available through Remote Server Administration Tools (RSAT). Import it, and run PowerShell as an administrator from a domain-joined machine.
Import-Module ActiveDirectory

Move a single computer to another OU

Move-ADObject accepts an objectês distinguished name (DN) or GUID for -Identity. Get-ADComputer also accepts a computerês sAMAccountName, such as WKSTN-0421. Use Get-ADComputer to look up the computer, then pipe the returned object to Move-ADObject. Specify the destination OU or containerês DN with -TargetPath:

Get-ADComputer -Identity "WKSTN-0421" | Move-ADObject -TargetPath "OU=Sales,DC=corp,DC=com"

If you don't know the destination OU's distinguished name, look it up with Get-ADOrganizationalUnit and pass the DN through:

$target = Get-ADOrganizationalUnit -LDAPFilter "(name=Sales)"
Get-ADComputer -Identity "WKSTN-0421" | Move-ADObject -TargetPath $target.DistinguishedName
Note:

If multiple OUs have the same name, the LDAP filter may return more than one result. Make sure you select the intended destination OU before running the move.

Preview and confirm the move safely

Because a move changes an object's location and the policy it receives, preview it first. The -WhatIf parameter reports what would happen without making the change, and -Confirm:$false suppresses the prompt in an unattended script:

# Preview only
Get-ADComputer -Identity "WKSTN-0421" | Move-ADObject -TargetPath "OU=Sales,DC=corp,DC=com" -WhatIf
# Run without a prompt
Get-ADComputer -Identity "WKSTN-0421" | Move-ADObject -TargetPath "OU=Sales,DC=corp,DC=com" -Confirm:$false

Move multiple computers in bulk from a CSV file

To move many machines at once, prepare a CSV with a Name column (and optionally a per-row OU column), and loop it through Move-ADObject. Resolve each computer to its distinguished name with Get-ADComputer so the -Identity value is unambiguous:

$targetOU = "OU=Workstations,DC=corp,DC=com"
Import-Csv "C:\Imports\computers.csv" | ForEach-Object {
    $computer = Get-ADComputer -Identity $_.Name
    Move-ADObject -Identity $computer.DistinguishedName -TargetPath $targetOU -Confirm:$false
    Write-Host "Moved $($computer.Name)"
}

Passing a computer name directly to Move-ADObject can result in an identity resolution error, such as the Cannot find an object with identity error, since the cmdlet expects a distinguished name, GUID, or SID. Resolving the object with Get-ADComputer first prevents the issue.

Verify the move and handle protected objects

After moving, confirm each computer's new location by reading its distinguished name:

Get-ADComputer -Identity "WKSTN-0421" | Select-Object Name, DistinguishedName

If a move fails with an access is denied error even though you have rights, the object may have ProtectedFromAccidentalDeletion enabled, which also blocks moves. Clear it first, then move the computer:

Set-ADObject -Identity (Get-ADComputer "WKSTN-0421").DistinguishedName -ProtectedFromAccidentalDeletion $false

Use caution when disabling accidental-deletion protection. Re-enable it after the move if the object should remain protected.

In an environment with multiple domain controllers, allow for AD replication, or initiate replication if necessary, before relying on the change being visible on every DC.

Supported parameters

Parameter/cmdlet Description
Move-ADObject Moves an object to a different OU or container
-Identity The object to move, given as a distinguished name, GUID, or SID
-TargetPath The distinguished name of the destination OU
-WhatIf Previews the move without applying it
-Confirm:$false Suppresses the confirmation prompt for unattended scripts
Get-ADComputer Retrieves a computer object; used to resolve its distinguished name
Get-ADOrganizationalUnit Finds the destination OU's distinguished name
Set-ADObject -ProtectedFromAccidentalDeletion Clears deletion protection, which otherwise blocks a move

Limitations of using PowerShell

  • Scripting is required for scale: Bulk and conditional moves mean writing and testing a script with its own error handling and logging.
  • Identity errors are easy to hit: Passing a computer name instead of a distinguished name causes the move to failãa common source of errors in scripts that process multiple computers.
  • Approval and auditing require additional setup: PowerShell moves have no built-in approval workflow. Native AD auditing can only record who moved which computer when the relevant audit policies and object auditing settings are configured.
  • Delegation is coarse: Letting help desk staff move computers safely, scoped to certain OUs, requires delegating directory rights carefully or building wrapper scripts.

How to move AD computers using Active Directory Users and Computers

Prerequisites

  • Permissions: Membership in either the Account Operators or Domain Admins groups, or delegated rights to move objects between the source and destination OUs.
  • Tools: The Active Directory Users and Computers console, available through RSAT on a Windows 10 or 11 computer and installed by default on a domain controller.

Steps to follow

  1. Open Active Directory Users and Computers by running dsa.msc.
  2. Locate the computer in its current OU (or the Computers container), or use Action > Find to search for it.
  3. Right-click the computer and select Move (you can also drag and drop it into the target OU).
  4. In the Move dialog box, select the destination OU and click OK.

Limitations of using Active Directory Users and Computers

  • One object at a time: ADUC has no bulk path for moving many computers or moving across many OUs in a single action.
  • No preview or logging: The console doesn't preview a move or keep a record of what was moved and by whom.
  • Policy changes silently: Moving a computer to another OU can change the Group Policy settings that apply to it when policy processing occurs with no warning about what it gains or loses.

How to move AD computers using ADManager Plus

ADManager Plus is a unified AD, Exchange, and Microsoft 365 management and reporting tool that lets administrators move individual computer accounts or multiple computer accounts simultaneously through a point-and-click console without writing scripts. It also maintains an audit trail of administrative actions.

Move computers in bulk

  1. Navigate to Management > Computer Management > Bulk Computer Modification > Move Computers.
  2. Choose the destination OU using the Select Container field.
  3. Enter the names of the computers to move or select CSV Import to move multiple computers in bulk.
  4. Click Apply.
Moving AD computers using ADManager Plus

Move computers directly from a report

ADManager Plus also enables you to move computers directly from a report. For example, generate a computer report, select the computers you want to move, click ellipsis (...), and select Move Computers.

Moving AD computers from a report using ADManager Plus

Automate computer moves

Use ADManager Plusê Automation to move newly joined computers to the appropriate OUs or relocate computers that have been inactive over a period to support Active Directory cleanup. Route sensitive moves through approval workflows so each move is signed off before it runs.

Configuring an automation to move inactive computers using ADManager Plus

Troubleshooting common move errors

  • Cannot find an object with identity: The -Identity value is a bare computer name which Move-ADObject can't resolve. Pipe the output of Get-ADComputer to Move-ADObject, or pass the distinguished name so the identity is unambiguous.
  • The argument is null on -Identity: A CSV column name doesn't match what the script references (for example Name vs. CompName), so the value is empty. Confirm the CSV header and the property you read.
  • Access is denied: Either the account lacks rights on the source or destination OU, or the computer has ProtectedFromAccidentalDeletion enabled. Verify delegation, clear the protection settings, and retry.
  • The object isn't found right after creation: In a provisioning or imaging flow, the computer account may not exist yet. Wait until the account is available before attempting the move, as shown in the use cases below.
  • The change isn't visible yet: In a multi-DC environment, the move may not have replicated to the DC you're querying. Allow replication to converge, or force it, then verify again.

How ADManager Plus helps you manage computer objects

ADManager Plus replaces scripts and one-off console edits with a single console for AD, Microsoft 365, and Exchange management and reporting:

  • Move computers in bulk across OUs from a GUI or CSV, without manually entering distinguished names or writing complex scripts.
  • Report on computer objects, including inactive and stale machines, and act on the results such as moving or disabling them directly from the report.
  • Automate stale-computer cleanup on a schedule, moving inactive machines to a quarantine OU, with approval workflows for sensitive changes.
  • Delegate computer management to help desk technicians through role-based, granular permissions, scoped to specific OUs without elevating their native rights.

Real-world use cases

Use case 1: Move a computer from the default Computers container to another OU

A common need is relocating a single machine out of the default Computers container into a department or site OU, so it picks up the right Group Policy. If you don't know the destination OU's distinguished name, retrieve it first, then pipe the computer into the move.

$target = Get-ADOrganizationalUnit -LDAPFilter "(name=Charlotte)"
Get-ADComputer "WIN7-C1" | Move-ADObject -TargetPath $target.DistinguishedName

With ADManager Plus

  1. Navigate to Management > Computer Management > Move Computers.
  2. Choose the destination OU and the computer from the default Computers container, then click Apply.
Moving a computer from the default Computers container using ADManager Plus

Use case 2: Bulk-move computers from a CSV file

When machines are spread across many OUs and need to be consolidated, a CSV-driven move handles them in one run. The reliable pattern resolves each computer to its distinguished name before moving it, which avoids the Cannot find an object with identity error that a bare name produces.

$targetOU = "OU=NewOU,DC=corp,DC=com"
Import-Csv "C:\Imports\computers.csv" | ForEach-Object {
    $computer = Get-ADComputer -Identity $_.Name
    Move-ADObject -Identity $computer.DistinguishedName -TargetPath $targetOU -Confirm:$false
    Write-Host "$($computer.Name) moved successfully"
}

With ADManager Plus

  1. Navigate to Management > Computer Management > Move Computers, and choose the CSV Import option.
  2. Import the CSV of computers, select the destination OU, and click Apply.
Moving AD computers using a CSV in ADManager Plus

Use case 3: Move a computer to its OU as soon as it's created

In a VM-provisioning or imaging flow, a new computer account first lands in the default container, and the next task often fails unless the machine is already in its target OU. Because build times vary, a fixed delay is unreliable; instead, check every three seconds until the computer account appears in AD, then move it to the target OU.

do {
    Start-Sleep -Seconds 3
} until (Get-ADComputer -Identity $serverName -ErrorAction SilentlyContinue)
$serverDN = (Get-ADComputer -Identity $serverName).DistinguishedName
Move-ADObject -Identity $serverDN -TargetPath $targetOU

For imaging with Configuration Manager (formerly SCCM), a task-sequence step can run the move against a domain controller using remoting, so the AD module doesn't need to be present in the task sequence:

Invoke-Command -ComputerName "dc1.corp.com" -ScriptBlock {
    Import-Module ActiveDirectory
    Get-ADComputer $args[0] | Move-ADObject -TargetPath "OU=Workstations,DC=corp,DC=com"
} -ArgumentList $env:computername

With ADManager Plus

Use Automation to move newly created computers that match a naming pattern to the designated OU according to a configured schedule or automation rule, so staging doesn't depend on timing a script to the build.

Configuring an automation to move newly created AD computers using ADManager Plus

Use case 4: Move a computer without RSAT installed

On a machine that doesn't have the Active Directory module, you can still move a computer object. One option is to proxy the cmdlets to a domain controller with remoting; another is the ADSI approach, which uses no modules at all.

PowerShell (remoting, no RSAT needed locally)

Invoke-Command -ComputerName "dc1.corp.com" -ScriptBlock {
    Import-Module ActiveDirectory
    Get-ADComputer "WKSTN-0421" | Move-ADObject -TargetPath "OU=Sales,DC=corp,DC=com"
}

PowerShell (ADSI, no module)

$computer = [ADSI]"LDAP://CN=WKSTN-0421,CN=Computers,DC=corp,DC=com"
$targetOU = [ADSI]"LDAP://OU=Sales,DC=corp,DC=com"
$targetOU.MoveHere($computer.ADsPath, $null)

With ADManager Plus

The web console moves computers from any browser, with no module or RSAT on the technician's machine needed, so this constraint doesn't arise.

FAQ

Moving a computer in Active Directory means relocating its account object from one OU to another. The computer itself and its domain membership are unchanged; what changes is which Group Policy and delegated permissions apply to it, since those are tied to the OU. In PowerShell, a move is done with Move-ADObject -TargetPath.

A computer is usually added to AD by joining it to the domain from the device itself through Windows' domain-join settings. This creates its account automatically in the default Computers container. To create the account ahead of time (pre-staging), use New-ADComputer -Name "WKSTN-0421" -Path "OU=Workstations,DC=corp,DC=com" in PowerShell, or create it in Active Directory Users and Computers. You can then move it between OUs as covered above.

Use Get-ADComputer with a filter and pipe it to Export-Csv. For a script-free approach, ADManager Plus generates detailed computers reports that can be scheduled and exported in different formats.

ADManager Plus Trusted By

The one-stop solution to Active Directory Management and Reporting