Hi Team, I have one Group ID like Comfin\SQL_ADMIN. I want to know which all user are in this Group ID.
asked Apr 06, 2011 at 08:31 AM in Default
If it is AD or Local group, then this info is not accessible from within SQL Server instance. Alhough there are some methos which enables querying AD.
You could create a linked server using OLE DB Provider for Microsoft Directory Services. You can use this provider also in OPENROWSET command etc. It is possible to write CLR method which will handle this.
In case you were speaking about role, then SQL Server reole members you can easily list as follow:
You can check this microsoft KB Article Performing a SQL distributed query by using ADSI which describes how to query LDAP from SQL Server. There are links to many sources related to querying ActiveDirectory and LDAP. Don't know if they mention this somewhere in the article, but you have enabled Ad Hoc Distributed Queries on the server to use ADSI.
If this is a Windows Group and you don't have control over the group or access to Active Directory Users and Computers then ask a member of your security team who manages AD to provide you with a list. If you have access to query this yourself @Pavel Pawlowski has given you a top notch way of getting the data yourself if this is something you need on a regular basis. Otherwise you could install the Admin Pack for windows on your workstation and access AD through start, programs, Administrative Tools, Active Directory Users and Computers and search AD that way. Your options are numerous for this.
answered Apr 07, 2011 at 07:28 AM