Running Active Directory Services Queries Using MS SQL Server OPENQUERY Command
Using Microsoft SQL Server, you can connect to Microsoft Active Directory Services applications in your network and query users or objects in the Active Directory Services.
Source: www.kodyaz.com