Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL Oracle active directory , +
Hi I've done some research on this matter but can't find a real answer for this: The company needs to sync a user table with the active directory. We are using LDAP from a Oracle database to connect to the AD. Ok at first didn't sound hard BUT then researching how the Ad was organized it got complicated. The structure is at follows:
 
Active Directory Users and Computers
   +Saved Queries
   -Company.org
      -OrganizationalUnit(root this is where we start)
          -OU folder Regions
             +OU folder Computers
             -OU folder Users
                +Users we need
      +Other Stuff
The problem is the subtree its divided on Organizational units nested on organizational units. I've tried different approaches and as far as I have got is to list the OU Users Names, NOT the users instead, and list the OU of regions too. Just need a point in the right directions.
Posted 30-Aug-12 3:31am
Edited 30-Aug-12 3:38am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Ok i solved my issue,
 
Active Directory Users and Computers  
   +Saved Queries
   -Company.org
      -OrganizationalUnit <-----Starting Position
          -OU folder Regions
             +OU folder Computers
             -OU folder Users
                +Users we need
      +Other Stuff
 
Aparently using the DBMS_LDAP.SCOPE_SUBTREE it let me browse through all my starting position and all in between. Just had to tweak the filter to provide the users, its final form was:
(&(&(objectCategory=user)(objectClass=user)(memberOf=*)(samaccountname='||LDAP_USER||')))
Finally i got PL/SQL procedure that searches the Active Directory and updates the users table with a valid AD email Smile | :)
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 275
1 OriginalGriff 230
2 BillWoodruff 173
3 CPallini 155
4 Kamal Rocks 144
0 OriginalGriff 5,655
1 DamithSL 4,506
2 Maciej Los 3,997
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,180


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 7 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100