• I'm glad this script inspired you today!

    Here's a question for you. Have you executed my script? It only reports on SQL authenticated user accounts. So you would not get any certificate users and nt authority accounts.

    As for "sa" I would leave that in the report as you would want to know if someone has been playing account with that account.

    Thanks,

    Rudy

    tim.shirey (5/12/2011)


    Hey, you really inspired me today! We have some similar requirements for security auditing so I took the bones of your script to produce the scipt below. I did not want all your columns, but you could add them back in.

    This version doesn't need to loop it gathers everything in the select statement(s). I also removed the sa account, any certificate accounts, and domain users and groups.

    ----------------------------------------------------------

    -- SQL Login Audit --

    -- Find Local SQL Logins (remove sa, certificate users, --

    -- and nt authority) then audit the user --

    ----------------------------------------------------------

    Rudy