Using powershell to move a sub group of a OU in AD

someITGuy
someITGuy used Ask the Experts™
on
We have a spreadsheet with a list of 400+ PC's that need to be moved out of a OU containing 1000+ computer accounts to a different OU within the same AD domain. This is all being done on a Windows 2003 R2 domain controller so I believe powershell 2.0 is out.

Anyone have a powershell 1.0 script that can do this?

TIA.

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
PowerShell Developer
Top Expert 2010
Commented:

PowerShell 2 is in, although the AD CmdLets won't be helping out anyway. Down-level installer can be found here:

http://support.microsoft.com/kb/968929

I'd be inclined to grab Quest's CmdLets for this, then if that Excel file became CSV...

Import-CSV "WhateverFile.csv" | %{
  Move-QADObject $_.Name -NewContainer "yourdomain.com/newOU" -WhatIf
}

Where WhatIf is just  used for testing to see if it'll get us there.

Chris

Author

Commented:
I do have Powershell 2.0 installed on my desktop, is there a way to do this remotely? If I have to install PS 2.0 on a DC it would require a extensive change management process I would really rather aviod if possible.
Chris DentPowerShell Developer
Top Expert 2010
Commented:

Yep, you don't have to run the script snippet above on a DC. It can be done from any system that can connect to the domain. I tend to run most things like that on my laptop when I'm at work, rarely touching the servers themselves.

Chris

Author

Commented:
Mucho gracias.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial