List the members of the sysadmin role
Query listing the logins that belong to the fixed server role sysadmin, with their disabled status.
This query lists the logins that are direct members of the fixed server role sysadmin, with their disabled status.
SELECT 'Name' = sp.NAME
,sp.is_disabled AS [Is_disabled]
FROM sys.server_role_members rm
,sys.server_principals sp
WHERE rm.role_principal_id = SUSER_ID('Sysadmin')
AND rm.member_principal_id = sp.principal_id
Notes
- Only direct members are listed. A Windows group that holds the
sysadminrole appears as one row (the group name); its members are not expanded. Is_disabledis 1 for a disabled login and 0 otherwise.