Solved

How to query LDAP(Microsoft Active Directory Services) from IBM db2 UDB

Posted on 2012-04-10
1
1,047 Views
Last Modified: 2012-06-27
I found the following code to use SQL Server 2005 to query information in my Active Directory structure:

Found at: http://www.bravesoft.com/blog/?p=24 

EXEC sp_addlinkedserver 'ADSI', 'Active Directory Services 2.5',ADSDSOObject', 'adsdatasource'
....
EXEC master..xp_sprintf @cmdstr OUTPUT, 'SELECT mail, employeeID, displayname, distinguishedName FROM OPENQUERY( ADSI, ''SELECT distinguishedName, displayname, employeeID, mail FROM ''''LDAP://DC=mycompany, DC=int''''WHERE objectCategory = ''''Person'''' AND SAMAccountName = ''''%s*'''''' )'

Open in new window


This code works from SQLServer2005, but can someone point me to an equivalent method from a IBM db2 UDB database?

My goal is to (at a minimum) compare data from my H.R. system to the user attributes in Active Directory. If I can query AD and place the results in a table on my db2 box, I can accomplish this.

Thanks in advance.
0
Comment
Question by:bisdmain
1 Comment
 
LVL 37

Accepted Solution

by:
momi_sabag earned 500 total points
ID: 37830401
db2 does not have a built in interface to active directory like sql server has
you will have to write a user defined function that does that
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft has released remote PowerShell capabilities to all commercial Office 365 customers. So you can be controlled via PowerShell and not from the Office 365 admin center Download Windows PowerShell Module for Lync Online http://www.micros…
The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question