Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

move-adobject

$
0
0

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. 

.

 

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles