April 22, 2014 at 9:00 am
Hi all,
what is the best way to query all login details like A is 'sysadmin', B is 'public', C is sql login with 'ddladmin' something this this.
Can anyone help please?
April 22, 2014 at 9:45 am
Do you want who is logged on? (sp_who2)
April 22, 2014 at 9:46 am
You may want to look at fn_my_permissions: http://msdn.microsoft.com/en-us/library/foo30f97f00-03d8-443a-9de9-9ec420b7699b.aspx
You can also check for roles with IS_Member() - http://msdn.microsoft.com/en-us/library/foo77cb68a0-19b7-4fe1-ab17-e5587699631b.aspx
There's also an analogous server role function.
If you just want a larger view of all permissions, you might check the security catalog views and query your principle against membership in all roles: http://msdn.microsoft.com/en-us/library/foo4d5cf1bf-09a7-4ee0-9dbb-5c584750fc67.aspx. Also: http://www.sqlservercentral.com/scripts/Security/107669/
April 22, 2014 at 2:24 pm
I need to make a report in excel that all logins on sql sever has what kind of permission, roles whether or not sqladmins.....these kind of stuff. Any good scripts that gives all these info?
April 22, 2014 at 2:43 pm
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply