We have created a Linked Server to Active Directory and have a table that is
populated based on the users (EmployeeList). The EmployeeList table has an
identity column that we would like to use as the EmployeeID in AD, updated
through SQL.
Here's a sample:
UPDATE OPENQUERY (ADSI,
'SELECT EmployeeID, sn FROM
''LDAP://loki/ou=WestClinics,ou=Clinics-Mainland,ou=XXX,dc=YYY,dc=local''
WHERE objectCategory = ''Person'' AND objectClass = ''user''')
SET [EmployeeID] = 186
WHERE [sn] = 'Smith'
Whenever I try to execute, I get the following:
Msg 7390, Level 16, State 2, Line 2
The requested operation could not be performed because OLE DB provider
"ADSDSOObject" for linked server "ADSI" does not support the required
transaction interface.
So my question is - is it possible to update Active Directory through SQL?
Yes, is possible. I am currently working an a project that updates active
directory using a join from a view in sql server. I am using the employeeId
for matching the employee in sql server and in AD.
The problem that I am having is that when I try to update all employees from
sql into ad is updating all employees with the same information from the
first record returned.
I got a class for this that maybe if you haven't find a way for your project
I can share with you.
Let me know if you were able to complete your project.
For Update and insert download the trial version of Active Directory Admin &
Query Tool from
http://www.ldapsoft.com/activedirectoryadmintool.html