SQL ADSI Active Directory Create New Accounts

I have an ADSI connection on my SQL Server (2005) and I can query it using openquery. Is there a way to create new accounts (and / or) to edit existing ones?

Also, I would like to use openquery to access the data, but it looks like the only solution.

Here is an example request that I use:

SELECT 
  samaccountname,
  department,
  mail,
   displayName,
  employeeid
FROM OPENQUERY( ADSI, 
  '
  SELECT samaccountname, department, mail,  displayName, employeeid
  FROM ''LDAP://DC=MyDomainName,DC=MyDomainExtension''
  WHERE objectCategory = ''Person'' and objectClass= ''user''
  '
) 

thanks

+3
source share
1 answer

You cannot (at least not use ADSI SQL).

ADSI SQL , SELECT (. MSDN: " SQL Dialect" ). , OPENQUERY() - SQL Server.

, ( script ADSI ).

+5

Source: https://habr.com/ru/post/1702990/


All Articles