disabling logins--sql server 2005\2008

  • Could anyone please post the script for disabling logins(both sql & windows Authentication) which is not using or have been inactive for 60 days

  • SQL doesn't keep track of when logins are used. You'll have to set some form of logging up, login triggers or server-side trace should work.

    Once you have the data from that logging, it's just ALTER LOGIN <login name> DISABLE I believe

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks for your quick response. Atleat please post the logon trigger script that which all the login details will record in a temp table along with date time when the connection establish.

  • Have a look in Books Online for logon triggers.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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