I have a piece of legacy code on a internal app that needs to be revised. Before I redo the whole thing is there an easy way to accomplish binding to AD where the OU can vary depending on the user who is authenticating. The setup is pretty standard:
my($mesg) = $ldap->bind ("cn=$uid,ou=Workers,ou=Domain Users,dc=something,dc=com", password => "$psswd");
Not all users are the "Workers" OU. Some are in a different OU... Basically what I am wondering is if there is a "if-then-else" routine for binding to AD from perl. I would prefer not to setup a third party account for the purpose of searching for this if it can be avoided... But almost all the documentation I had read seems to point to this method of login. Any ideas or suggestions?