Skip to main content
AD Academy
Back to all recipes
Level: JuniorLast updated:

Move computers to a different OU

Get-ADComputer -Filter 'Name -like "LAB-*"' |
  Move-ADObject -TargetPath "OU=Lab,OU=Workstations,DC=corp,DC=local" -WhatIf

Why it works this way

GPO applies by OU. A host left in the default Computers container never receives your policy.

Watch out

  • Drop -WhatIf only after reviewing the list.
  • After the move: gpupdate /force on the host, sometimes a reboot.

Related events

Similar recipes