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*'''''' )'
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.