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.
zohre aghaeiAsked:
Who is Participating?
 
Shaun VermaakConnect With a Mentor Technical Specialist/DeveloperCommented:
1
 
Mr MystikalCommented:
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.
0
 
zohre aghaeiAuthor 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?
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
Mr MystikalCommented:
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.
0
 
zohre aghaeiAuthor Commented:
thank you very much for your guidance , i will do research, hope to find
1
 
Mr MystikalCommented:
Shaun Vermark's post provided the most direct guidance to this question , no further comments have been made in approx 14 days.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.