Move bulk Computer object to OU using CSV file.

Move Bulk computers to OU, Active Directory, powershell to move computer object to OU

 

$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

}

Join the conversation