Function that returns the login of an AD Group

  • Hi DBA's,

    I will use Resource Governor in the SQL Server 2008 R2. I want to limit the resource usage from one group of users of my Domain. I have created a login in the SQL Server that is mapped to a group in my AD.

    My problem is that I can't find a function that returns me the name of the AD Group which is the same of the login. The function USER, SUSER_SNAME, CURRENT_USER, SESSION_USER, all of them return the Windows account login, not the Windows group, that is the same as the SQL Server login.

    Is there any function that returns the AD group?

    Thanks in advance,

    Lucas Benevides

    DBA Cabuloso

    ________________
    DBA Cabuloso
    Lucas Benevides

  • Try the IS_MEMBER function.

    http://msdn.microsoft.com/en-us/library/ms186271.aspx

  • also, these two extended procs examples might help.

    one tells you who belongs to a group, the other can tell you all the groups i belong to:

    EXEC master..xp_logininfo

    @acctname = 'mydomain\lowell',

    @option = 'all' -- Show all paths a user gets his auth from

    go

    EXEC master..xp_logininfo

    @acctname = 'mydomain\authenticatedusers',

    @option = 'members' -- show group members

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Thanks a lot.

    The function IS_MEMBER is exactly what I needed.

    Best Regards,

    Lucas Benevides

    DBA Cabuloso

    ________________
    DBA Cabuloso
    Lucas Benevides

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply