Getting user data from Active Directory using PL/SQL
        Posted  
        
            by David Neale
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by David Neale
        
        
        
        Published on 2010-05-17T20:33:09Z
        Indexed on 
            2010/05/18
            6:30 UTC
        
        
        Read the original article
        Hit count: 296
        
I had a discussion today regarding an Oracle procedure I wrote some time ago.
I wanted to get 7500 user email addresses from Active Directory using PL/SQL. AD will return a maximum of 1000 rows and the LDAP provider used by Oracle will not support paging.
Therefore, my solution was to filter on the last two characters of the sAMAccountName (*00,*01,*02...etc.). This results in 126 queries (100 for account names ending in digits, 26 for those ending in a letter...this was sufficient for my AD setup).
The person I was speaking to (it was a job interview by the way) said he could have done it a better way, but he would not tell me what that method was.
Could anybody hazard a guess at what this method was?
© Stack Overflow or respective owner