|
|
|
SSC 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
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 1:55 PM
Points: 888,
Visits: 1,848
|
|
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 ----------------------------------------------------------------------------- http://www.sqlservercentral.com/articles/Best+Practices/61537/
|
|
|
|
|
SSC 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
|
|
|
|
|
Forum 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.
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 1:55 PM
Points: 888,
Visits: 1,848
|
|
|
|
|
|
Forum 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
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Friday, May 10, 2013 3:55 AM
Points: 126,
Visits: 751
|
|
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
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 1:55 PM
Points: 888,
Visits: 1,848
|
|
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 ----------------------------------------------------------------------------- http://www.sqlservercentral.com/articles/Best+Practices/61537/
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Friday, May 10, 2013 3:55 AM
Points: 126,
Visits: 751
|
|
Being able to read sometime helps
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Wednesday, March 20, 2013 5:30 PM
Points: 1,803,
Visits: 276
|
|
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.
|
|
|
|