Link to home
Create AccountLog in
Avatar of jfordhill
jfordhill

asked on

Who has CONTROL SERVER in SQL 2005?

How do I find out who has been granted the CONTROL SERVER priviledge in SQL Server 2005?
Avatar of Lowfatspread
Lowfatspread
Flag of United Kingdom of Great Britain and Northern Ireland image

have you tried sys.database_permissions
but presumably you'd also need to know if the id had dbo/sysadmin ... rights as  well..
sorry misread that as just CONTROL
Avatar of jfordhill
jfordhill

ASKER

sys.database_permissions appears to just be database level permissions.  I also checked sys.server_permissions, but I didn't see "CONTROL SERVER".
But I see from the following microsoft page that the "CONTROL SERVER" permission would be shown in the sys.server_permissions table:
 http://msdn2.microsoft.com/en-us/library/ms186260.aspx
Here's how I got my answer:

select b.name, a.permission_name from sys.server_permissions a, sys.server_principals b
where a.grantee_principal_id = b.principal_id
and permission_name = 'CONTROL SERVER'

ASKER CERTIFIED SOLUTION
Avatar of Vee_Mod
Vee_Mod
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer