Home Forums SQL Server 7,2000 Security Query/ Procedure to Generate list of logins and the DB access and their roles RE: Query/ Procedure to Generate list of logins and the DB access and their roles

  • well, i'd start with implicit users that come from windows groups:

    select *

    from master.sys.server_principals

    where type_desc = 'WINDOWS_GROUP'

    from there, for each name in the list, you can use a built in extended stored procedure which queries Active directory to enumerate all the users in the group

    EXEC master..xp_logininfo

    @acctname = 'disney\authenticatedusers', --an example windows group, where my domain is "disney"

    @option = 'members' -- show group members

    EXEC master..xp_logininfo

    @acctname = 'Builtin\Administrators',

    @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!