Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Can''t read sql_logins and don''t understand why Expand / Collapse
Author
Message
Posted Monday, June 25, 2007 4:14 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, June 1, 2009 2:16 PM
Points: 1, Visits: 4
As an audit requirement, we're trying to get a list of all SQL users (across all databases) to our IT audit team. We can do this simply enough logging in as a user with sysadmin role, but we'd prefer not to give that role to our automated report writer user. So, we're trying to select from sql_logins and all we get is sa and the report writer user (instead of the 91 users we should get). We've tried everything we know -- granting permission to sql_logins directly to the user, setting up a new group with permissions to the view & adding the user to it, etc. All to no avail. Any suggestions? Is this no longer possible? Thanks in advance.
Post #376432
Posted Monday, June 25, 2007 7:20 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, July 8, 2014 8:19 PM
Points: 1,393, Visits: 438
use master
go
GRANT VIEW ANY DEFINITION TO ReportUser;
go



Post #376457
Posted Monday, June 25, 2007 10:58 PM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Tuesday, September 23, 2014 9:22 AM
Points: 3,461, Visits: 351

Try this query given below.

use master

go

select * from sys.server_principals where type in ('U','G','S')



Cheers,
Sugeshkumar Rajendran
SQL Server MVP
http://sugeshkr.blogspot.com
Post #376492
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse