Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Finding all "sa" members

Author  Topic 

rosejr
Starting Member

12 Posts

Posted - 2009-01-26 : 11:47:39
I am looking for suggestions on how to find all "sa" members for a network of servers.

I have to find out all 'sa' members for about 500 servers on a quarterly basis. Rather than going to each individual server to find out the 'sa' members. Does anyone have a less time consuming approach or solution?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-01-26 : 13:04:00
[code]SELECT rol.name,
mem.name
FROM sys.server_role_members AS srm
INNER JOIN sys.server_principals AS rol ON rol.principal_id = srm.role_principal_id
INNER JOIN sys.server_principals AS mem ON mem.principal_id = srm.member_principal_id
WHERE rol.name = 'sysadmin'[/code]Have this script run by a job every now and then and insert to a central storage location with date of execution.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-01-26 : 13:29:51
And don't forget that you'll need to query the Active Directory if you've got Windows groups that are granted the sysadmin role. You can do this via T-SQL using this approach: http://weblogs.sqlteam.com/tarad/archive/2008/06/23/How-to-get-information-about-Windows-users-and-groups-using.aspx

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -