We help IT Professionals succeed at work.

move computers to specific ou

zohre aghaei
zohre aghaei asked
on
78 Views
Last Modified: 2017-12-07
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.
Comment
Watch Question

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.

Author

Commented:
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?
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.

Author

Commented:
thank you very much for your guidance , i will do research, hope to find
Senior Consultant
CERTIFIED EXPERT
Awarded 2017
Distinguished Expert 2019
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
Shaun Vermark's post provided the most direct guidance to this question , no further comments have been made in approx 14 days.