This was part of a message in my inbox, it was about using OldCmp and this was one of the questions.
We want to move all the users into the appropriate OU based on the first two digits of their username. Can we move users into an OU?
Something like: -move –b ou=Carlisle, dc=domain, dc=com –af “(name=ca*)”
My response
Do you want to move any users with that prefix or do you want to do it based on their age?
If you just want to move them regardless, use adfind output piped to admod to do it… Something like
adfind -b ou=blah,dc=domain,dc=com -f “name=ca*” -dsq | admod -move ou=newparent,dc=domain,dc=com -upto xxx
where xxx is the max number you want to move at once. If you don’t know how many there are but want to move them all, you can use -unsafe instead of -upto.
Now if you do want to do it based on age as well, then you will want to use oldcmp and would look something like
oldcmp -move -users -age XX -newparent ou=newparent,dc=domain,dc=com -f “(name=ca*)”
joe