Need a script that lists all logins for entire server

  • Hi all,

    I need a script that lists all human users (not groups or roles) for entire server. And it also should include those users who have permissions through Windows or SQL Server roles or groups.

    It should return 2 result-sets: read-only users and read-write users.

    If a user has a read-write permission for at least one database - (s)he goes to read-write list. Also, all members for any group that has Admin privileges go to read-write result.

    I already started to write such a script, but I am afraid that I am missing something. I would appreciate if somebody will share a script or a similar one, I can tweak it for my needs. I will remove duplicates if some user is listed more than once. We need it for our security audit.

    Thanks in advance

  • Whomever is doing the security audit should have one of their own.

    Also, please try Google on this question.  You'll find lots of scripts.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 2 posts - 1 through 1 (of 1 total)

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