Need SQL Script or code to get the details of Server Authentication and Login Auditing Details.

  • We can get these details from SSMS by rightclick on SQL Server ->Properties ->Security

    But i need the script for those because i need to run this scrips on a couple of servers grouped together.

    Please suggest me.

    Thanks

    Karan

  • On the Security Tab, make some small changes in the configuration and click on "Script". This will generate the script in a new query window. Then click on "Cancel" to undo the small changes that you have done.

    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @pradeepadiga

  • Both those values are registry settings that are used when SQL Server starts up; accessible at HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.InstanceName\MSSQLServer

    Values to check AuditLevel (values 0, 1, 2)

    - 0 - None

    - 1 - Successful only

    - 2 - Failed Only

    - 3 - Both

    Value to check LoginMode (values 1, 2)

    - 1 - Windows Only

    - 2 - SQL & Windows

    [font="Arial"]---

    Mohit K. Gupta, MCITP: Database Administrator (2005), My Blog, Twitter: @SQLCAN[/url].
    Microsoft FTE - SQL Server PFE

    * Some time its the search that counts, not the finding...
    * I didn't think so, but if I was wrong, I was wrong. I'd rather do something, and make a mistake than be frightened and be doing nothing. :smooooth:[/font]

    How to ask for help .. Read Best Practices here[/url].

  • SQLTeam Blog has plenty of scripts for this type of thing. This should be the one you are looking for. They also have ones to use if you need to change it on multiple servers.

    Shawn Melton
    Twitter: @wsmelton
    Blog: wsmelton.github.com
    Github: wsmelton

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply