Solved

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

Posted on 2012-04-10
1
1,054 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Suggested Solutions

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

759 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