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 123»»»

Script to list all logins and permissions Expand / Collapse
Author
Message
Posted Wednesday, July 01, 2009 9:34 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, June 17, 2011 10:05 AM
Points: 85, Visits: 394
For auditing purposes, we need to produce a monthly report showing any logins on our production database, along with permissions to any objects they have been granted.

We've used sp_helplogins to produce this information, but we wondered if there is a more comprehensive system stored procedure for this purpose, or if anyone has a custom script they use for retrieving login information?

Thanks,
Kay
Post #745531
Posted Thursday, July 02, 2009 9:52 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 7:30 AM
Points: 1,270, Visits: 2,399
I have something that I use that may be a little more encompassing then what you are asking for but it does include login role membership and object permissions. You should be able to get what you need out of it.

The code attached collects role and permission info across multiple databases so if you want to use the code as-is you will have to create all the tables in the script as well as linked servers to any of the servers you would like to audit. You will then have to populate the servers table with the servername(s)/linked servername(s) you wish to audit.

note: this is a work in progress so some columns may not get populated.


Bob
-----------------------------------------------------------------------------
How to post to get the best help


  Post Attachments 
permission_audit.txt (1,902 views, 26.61 KB)
Post #746408
Posted Thursday, July 02, 2009 10:00 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, June 17, 2011 10:05 AM
Points: 85, Visits: 394
Thanks for the response, Bob. I'll tweak the script and see if I can pull out the information we need. I appreciate your help.

Kay
Post #746415
Posted Tuesday, February 23, 2010 9:34 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, December 03, 2010 5:25 PM
Points: 7, Visits: 137
This script was creting tables but not undating data. Please help me what do I need to do next.
Post #871257
Posted Tuesday, February 23, 2010 1:15 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 7:30 AM
Points: 1,270, Visits: 2,399
the table population is in the script. What part are you having trouble with?

Bob
-----------------------------------------------------------------------------
How to post to get the best help
Post #871422
Posted Tuesday, February 23, 2010 1:27 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, December 03, 2010 5:25 PM
Points: 7, Visits: 137
I executed complete script successfully. But only tables were created no rows wer inserted into tables.

I did not get any error meassage
Post #871434
Posted Wednesday, February 24, 2010 4:37 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, March 10, 2014 1:08 AM
Points: 130, Visits: 795
Hi,
Thanks for this very comprehensive script. I tried to help and run it on one of my servers but I see the same as kwilt.
Script runs through reporting success but none of the tables have data. First issue must be on the servers table as this is used later on.
Cheers
Post #871826
Posted Wednesday, February 24, 2010 10:50 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 7:30 AM
Points: 1,270, Visits: 2,399
I stated in my original post that the servers table has to be populated manually with the server/linkedservername. All other columns in server table are handled by the script.

ie.
insert into servers(name)
values('Server1')



Bob
-----------------------------------------------------------------------------
How to post to get the best help
Post #872074
Posted Thursday, February 25, 2010 1:43 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, March 10, 2014 1:08 AM
Points: 130, Visits: 795
Being able to read sometime helps
Post #872520
Posted Tuesday, December 07, 2010 5:30 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, April 15, 2014 8:24 PM
Points: 1,856, Visits: 301
Thanks for this script Bob.

I have made a number of tweaks to suit my purposes, but it has saved me a heap of investigation time to find out where everything is stored.

Post #1031599
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse