I'm trying to read a file of machines and then move them to a different OU within AD. Right now my machines.txt only has 1 computer name.
$FindPC=Get-Content"c:\temp7\machines.txt"
$NewOU
='OU=test,OU=MGH_Workstations,DC=Acme,DC=org'
foreach
($pcin$FindPC) {Move-ADObject-TargetPath$NewOU}
when I run this code I get this error.
Move-ADObject : Cannot find an object with identity: 'mg2014' under: 'DC=acme,DC=org'. mg2014 is the machine listed within machines.txt too. All OU's do exist.
.