Created
October 22, 2014 14:23
-
-
Save michaeljbailey/f0ea47818cc44951be8e to your computer and use it in GitHub Desktop.
Finds all users in the sysadmin role that are not the sa account or are NT Services.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT name | |
FROM master.sys.syslogins [Login] | |
WHERE [Login].[sysadmin] = 1 | |
AND [name] <> 'sa' | |
AND [name] NOT LIKE 'NT Service%' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment