Monday, March 12, 2012

How Can i know how many USERS are in agroup.

HI all
I just wana know that is there is any TSQL Statement which will give me
the list of all user groups,names of user in each group and thier
Permssions in any database/server.
Actually I have to create a report in wich i have to show that how
many groups we have any whi is the member of wich group with such
permissions.I ckeck through Interprise Manager but i guess it will take
alot of time to note every user group then users and their permissions.
So please any HELP will be greatly Appriciated.

Thanks

Arman(ch.adilaziz@.gmail.com) writes:

Quote:

Originally Posted by

I just wana know that is there is any TSQL Statement which will give me
the list of all user groups,names of user in each group and thier
Permssions in any database/server.
Actually I have to create a report in wich i have to show that how
many groups we have any whi is the member of wich group with such
permissions.I ckeck through Interprise Manager but i guess it will take
alot of time to note every user group then users and their permissions.
So please any HELP will be greatly Appriciated.


Before I try anything, I would like some clarification. With "groups" do
you mean what is normally called "roles" in SQL Server? That is grouping
of users within a database?

Or do you mean Windows groups as in DOMAIN\OFFICEUSERS?

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Erland Sommarskog wrote:

Quote:

Originally Posted by

Before I try anything, I would like some clarification. With "groups" do
you mean what is normally called "roles" in SQL Server? That is grouping
of users within a database?
>
Or do you mean Windows groups as in DOMAIN\OFFICEUSERS?


Even if Arman meant roles, I'd like to ask you similar question
according to Windows groups. Is it possible to list Windows group
members using T-SQL? Let's assume that I'm a sysadmin, but not domain
admin.

--
Best regards,
Marcin Guzowski
http://guzowski.info|||Marcin A. Guzowski wrote:

Quote:

Originally Posted by

Erland Sommarskog wrote:

Quote:

Originally Posted by

Before I try anything, I would like some clarification. With "groups" do
you mean what is normally called "roles" in SQL Server? That is grouping
of users within a database?


Question #1:

Answer : Yes

sp_helpuser

Quote:

Originally Posted by

Quote:

Originally Posted by

Or do you mean Windows groups as in DOMAIN\OFFICEUSERS?


>
>
Even if Arman meant roles, I'd like to ask you similar question
according to Windows groups. Is it possible to list Windows group
members using T-SQL? Let's assume that I'm a sysadmin, but not domain
admin.
>
>


Question #2:

Answer: Yes, set up a linked server with your pdc server / active
directory and use open query to query this information from the linked
server.

http://www.fits-consulting.de/blog/...2e73b00faa.aspx

Quote:

Originally Posted by

--
Best regards,
Marcin Guzowski
http://guzowski.info

|||jebuskrust@.gmail.com wrote:

Quote:

Originally Posted by

Question #2:
>
Answer: Yes, set up a linked server with your pdc server / active
directory and use open query to query this information from the linked
server.
>
http://www.fits-consulting.de/blog/...2e73b00faa.aspx


I found much easier way:
exec master.dbo.xp_logininfo 'DOMAIN\GROUP','members'

It will list all members of desired Windows group*, without the need
of setting up a linked server.
[*] only groups granted access to SQL Server are concerned

--
Best regards,
Marcin Guzowski
http://guzowski.info

No comments:

Post a Comment