One thing I like to do occasionally, or when “inheriting” a new SQL server, is to check which users have sysadmin privileges. As these users have access to
perform any activity in SQL Server it’s important to keep the number of these users to a minimum especially on production systems.
The following script will list all sysadmins on a server, in name order :
SELECT
name,type_desc,is_disabled
FROM
master.sys.server_principals
WHERE
IS_SRVROLEMEMBER ('sysadmin',name) = 1
ORDER BY name
Related Articles
The following articles may also be of interest :
Link back to this article :
https://www.sqlmatters.com/Articles/Checking for users with sysadmin privileges.aspx
Keywords
SQL,scripts,sysadmin,security,audit