The first method to query Active Directory from SQL Server is by using OpenRowSet. Note: Please replace the OU, DC and CN information mentioned here with your company’s OU, CN and DC. In this article, I am going to use the following OU and DC. DC is domain containers that are created by separating the full internal domain name.OU is organizational units that usually contain objects such users, contacts, groups and other OUs.CN is containers that are usually defined as users, contacts, groups.You could query ADSI just by using the domain name and domain container. All the three are not mandatory to retrieve information. In order to query data from Active Directory, you need to know the Organizational Units, containers and domain controllers. This article illustrates how to use SQL Server Transact SQL with OPENROWSET and OPENQUERY commands to access and retrieve data from Active Directory. Though it is predominantly used by network administrators and system administrators, there are situations where SQL Server Database administrators or the application that uses SQL Server as the backend needs to get data from ADSI. Active Directory Service Interfaces, also known as ADSI, is a set of COM interfaces used to access the directory services to retrieve data.
0 Comments
Leave a Reply. |