Move bulk Computer object to OU using CSV file.
$ComputersPath= Import-Csv -Path "D:\XYZ\Computers.csv"
$TargetOU = "OU=WorkStations,DC=bbn,DC=com"
foreach ($item in $ComputersPath)
{
$computer = Get-ADComputer $item.CompName
Move-ADObject -Identity $computer.DistinguishedName -TargetPath $TargetOU -Confirm:$false
Write-Host Computer account $computer.Name has been moved successfully
}
Comments