Hi all, I would like to audit the use of sysadmin level accounts on my Sql Servers (Mostly 2000, a couple of 2K5, and most recently 2K8), as I suspect (but can't prove) that our developers are adding themselves to the SQL Administrators group, changing the Live servers, then removing themselves . . . No denying access to the group would not be acceptable . . . unless I can get proof.I have a stored procedure based on sp_who that does audit particular logins, but want to change this to include any members of the sysadmin server role. .. . mostly working apart from one thing Logins granted access via an AD Group do not show up . . . I'm using SELECT IS_SRVROLEMEMBER( 'sysadmin' , p.loginame ) IsSysAdmin , * FROM master.sys.sysprocesses p
to get the current logged in users, but IS_SRVROLEMEMBER returns NULL for any user that has been granted a login via an AD Group.For myself if I useSELECT IS_SRVROLEMEMBER( 'sysadmin' ) -- Current Logged in User
I get a 1 returned . . . The current user is a member of sysadmin . . . and I do not have an explicit login on that box only as a member of DOMAIN\SQLServerAdmins. if I useSELECT IS_SRVROLEMEMBER( 'sysadmin' , 'DOMAIN\MyLogin') -- A specific login User
I get a NULL returned . . . The documentation implies that SQL Server is unable to resolve the indirect login ???Any Ideas?-- RegardsTony The DBA