Hey All, for starters my PowerShell knowledge is limiited.
I have an OU that has many OU’s inside of it. The sub-OU’s have a naming convention. The ones I need to target start with “To Be” I can get the correct list of sub-OU’s by running the command
I can get a list of users using the ForEach-Object {Get-ADUser and supplying the common parameters.
My problem is that I cannot come up with any combination that will allow me to get all the users from all the OU’s that start with “To Be*” and move them to a single target OU.
I can either get all the OU’s or all the people from a single OU.
What would be the correct way to loop through all the OUs that start with “To Be*” and move all the users in these OU’s to a single targeted OU?
And BTW: When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
Thank you for your assistance. I was totally missing it. Also thank you for the code button info. I was looking for it but was looking in the wrong place. I see it now as I type this. You have been a great help.