Link to home
Start Free TrialLog in
Avatar of rdefino
rdefinoFlag for United States of America

asked on

Need power shell script to move a system to 1 of 3 OU's based on a registry entry

I need to come up with a script that will look at a registry entry on a system and based on that setting the script will move the system to 1 of 3 ou's.

Any thoughts on how to do this. It's above my abilities to script.

thanks
Avatar of David L. Hansen
David L. Hansen
Flag of United States of America image

Which registry entry are you going to key off of and do you already have a script that will move a system into a specified OU (without making any comparisons that is)?
Avatar of rdefino

ASKER

I don't have the keys yet, but I have a script I've used to moves systems. How would I reference a reg key from the script?

import-module ac*
gc e:\scripts\move_systems_to_ou\pclist.txt | % {
Get-ADComputer $_| Move-ADObject -TargetPath "New_OU"
}


Thanks
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial