In this example we will move selected computer accounts from csv file into target OU. You will need to prepare csv file similar the one below and name the first column “CN” and save it to server where you will be running the script from.This script will be very handy if you need to move computers from different locations into selected target OU.
You will need to change few things within the script to make it work within your environment.
$TargetOU = 'OU=Computers,OU=VA,DC=TekPros,DC=com' (Change this to make sure it suits your needs)
Here is the script
################################################################# #Importing AD Module foreach ($Computer in $MoveList){ Write-Host " Completed Move List " Write-Host " $countPC Computers has been moved " |
You can download the script from this link
https://gallery.technet.microsoft.com/scriptcenter/Move-AD-Computer-Object-4ed2c5f8
Oz Casey, Dedeal ( MVP North America)
MCITP (EMA), MCITP (SA)
MCSE , M+, S+, MCDST
Security+, Project +, Server +
http://telnet25.wordpress.com/ (Blog)
http://smtp25.blogspot.com/ (Blog)