Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

How can I move multiple user objects from one OU to a different OU in the same domain?

$
0
0

I know this has been answered here multiple times but no one answer appears to be complete. Each step brings a new error.

I've spent plenty of time and no training figuring out VBS, but I haven't bothered with PS until now. I don't have a baseline understanding of it just yet, but still, this shouldn't be so difficult. I must be missing something.

I've tried Win 7 and 2008. Win 7 has Quest ActiveRoles installed, 2008 does not. Currently, on Win 7 when running the script below, I get ==>  "Move-ADObject : A parameter cannot be found that matches parameter name 'newparentcontainer'

$users = gc C:\_SCRIPTS\UsersOUmove1.txt # gc = get-content $users | foreach-object { get-aduser $_ | move-adobject -newparentcontainer "OU=Users-Win7,OU=Users,OU=Dept1,DC=domain,DC=com" }


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>