Avatar of zohre aghaei
zohre aghaei
 asked on

move computers to specific ou

hi every body
i can move joined computers to an ou with redircmp
if i want to move some computers to a ou and other computers to another ou how can i do that?
for example move clients to "client ou" and move all servers in "server ou" Automaticly.
Windows Server 2012* ADUC

Avatar of undefined
Last Comment
Mr Mystikal

8/22/2022 - Mon
Mr Mystikal

Hi There,

Are you looking to have newly created objects moved based on criteria at the time of creation  or are you hoping to do it after the fact ?

As far as I can tell , Redircmp can only place new objects in a single OU , however if I were you , I'd look to create a powershell script inside a scheduled task from a server , use things like Get-ADComputer with properties like operating system etc to identify the object and then move it based on the logic.

I know this isn't exactly what you were hoping but maybe it helps ?

Reference 1 : Inventorying Computers with AD PowerShell

Reference 2 : The Easy Way to Use PowerShell to Move Computer Accounts

P.s naturally there is also an option to pre-create the AD objects for servers before joining them , the above is for inherited AD cleanups :P.
zohre aghaei

I want to change the path to my predetermined destination as soon as I send them to my domain.
so i think refrence2 is my answer, right?
Mr Mystikal

Hi Zohre,

Traditionally one should be pre-creating AD objects for servers before joining them to the domain , however I assume this is out of your control , so yes essentially you can use the examples in ref 2 to learn how to move objects in AD , you will still need to set it up as a scheduled task to run at a frequency of your choosing.

I recommend searching for Get-ADComputer and having a look around , it's harmless to simply query a computer object to see what properties you can use in your future scripts , since Unix OS's do not populate the OperatingSystem attribute on our end.

I've not yet found any better way online to automate what you're looking for.

Using WMI in your scripts would be another way , alas that might not work on Unix based OS's.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
zohre aghaei

thank you very much for your guidance , i will do research, hope to find
Shaun Vermaak

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Mr Mystikal

Shaun Vermark's post provided the most direct guidance to this question , no further comments have been made in approx 14 days.