April 30, 2010 at 4:44 am
Hi All
I have requirement where i need to generate a list of users who can login into the sql server 2000 and what are all the database they can access and their roles. I got some information from this link
http://www.sqlservercentral.com/articles/Administration/listofdatabaseuserswithdatabaseroles/1545/
After executing this I got a list of all users and their database access and roles. Then I realized something was missing. I used to login to sql server 2000 and execute sql statements. I am local system admin. I can see a login named Builtin\Administrator under security and this has access to all database as db_public and db_owner.
Here i have 2 questions
1. Why is Builtin\administrators not listed ? doest that mean that the procedure and query given in the link is wrong.
2. I can see certain users who has access to few of the databases. But these users are not in the login section under security. How can a user have access to database without a login ?
I would be extremely thankfull to you could clarify my queries.
Thanks in advance
Rahul
April 30, 2010 at 6:33 am
i think it's due to the query; do a select * from sysusers in any database. there's no Builtin\Administrators in that list.
the query is not showing implicit users who have access regardless of whether you added them or not; those users like sa get access because they are sysadmins, they do not need to be added to each db's sysusers list. It's just getting explicitly granted users and their permissions.
Lowell
May 3, 2010 at 2:19 am
HI Lowell
Thanks a lot for your response. Whats the correct query to show all implicit users as well.
Thanking you
Rahul
October 31, 2013 at 9:19 am
If you found a solution for ...whats the correct query to show all implicit users as well...please post. Thanks
October 31, 2013 at 10:08 am
well, i'd start with implicit users that come from windows groups:
select *
from master.sys.server_principals
where type_desc = 'WINDOWS_GROUP'
from there, for each name in the list, you can use a built in extended stored procedure which queries Active directory to enumerate all the users in the group
EXEC master..xp_logininfo
@acctname = 'disney\authenticatedusers', --an example windows group, where my domain is "disney"
@option = 'members' -- show group members
EXEC master..xp_logininfo
@acctname = 'Builtin\Administrators',
@option = 'members' -- show group members
Lowell
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply