List Active Directory Users My boss sent to request me that: I want to a SQL query, that lists all domain users of a specific group. I began to search query. I found several solutions using Linked Server. 

EXEC master.dbo.sp_addlinkedserver 
@server = N'ADSI', 
@srvproduct=N'Active Directory Service Interfaces', 
@provider=N'ADSDSOObject', 
@datasrc=N'adsdatasource'


then

EXEC master.dbo.sp_addlinkedsrvlogin 
@rmtsrvname=N'ADSI',
@useself=N'False',
@locallogin=NULL,
@rmtuser=N'DOMAIN\USER',
@rmtpassword='*********'


I replaced username and password with a domain admin user's information but I got this error


  Cannot create an instance of OLE DB provider "ADsDSOObject" for linked server "ADSI".


Our domain name is akilus.local, but I didn't replace the data source. 

What could the problem be?
Why is SQL Server required to do this task?  This isn't the objective of an RDBMS.  You would have to go through hoops to get SQL Server to find this data.

The quickest/easiest/most natural way to do this?  The Active Directory PowerShell module.  It's a one-liner:

Get-ADGroupMember "administrators" | Select-Object Name, DistinguishedName, ObjectClass


In short, keep logic like this away from SQL Server and put it in the OS where it belongs.