Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find user roles 1

Status
Not open for further replies.

fiep

Technical User
Sep 2, 2003
66
NL
Hi,

I have an application that uses SQL to store the information.
The authentication on the server is Windows Authentication and the users are all part of one or more Windows Groups. The Windows group is mapped to database roles in the database.

So it looks like this:
User is member of Windows Group --> Windows group has certain DB role.

How do I retrieve the roles for a given user?
So with what statements can I check which roles UserA has been granted?

Thanks.
 
Check out this FAQ. it should help

faq962-5411

- Paul
- If at first you don't succeed, find out if the loser gets anything.
 
Thanks ptheriault.

But I have seen that FAQ but that does not resolve my problem. It only selects the roles the user is added too directly. It does not does show inherited rigths through group membership.

I hope that is somehow possible.


Kind regards.
 
The procedure xp_logininfo can be used to find out the users in a Windows Group. It can also fine the group that the user will use to log into the database.
Code:
exec xp_logininfo 'Domain\UserName', 'all'
exec xp_logininfo 'BUILDIN\Administrators', 'members'

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
That's what I need. Thanks very much.
Here is a star.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top