Last time user loged in or any jobs ran

  • Is it anyway to find out when is the last time login user or account was used? I am trying to clean up my logins

  • Setup a "Login Trigger".  Be REALLY careful because, if you do it wrong", even you won't be able to login.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • I used to use Notification services for this, but recently we had major down time due to an overload of connections and SSB-queues not getting processed on time.

    We are now using Extended Events to capture logins and record them, so we know which accounts are currently still using our databases.

    Asynchrone by design, (role over) files maintained by SQLServer, a local sqlagent job processing it all and recording the data in a dba database.

     

    btw: article has been posted. Let's hope it is available soon ..

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • Another vote for Extended Events. Safe, as light weight as you can get while still monitoring behaviors on the system.

    However, yes, you'll have to set something up in order to capture this. No, you won't be able to know stuff that happened before you set up a system to capture the information.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Also, if you're only allowing for Windows logins by users and apps (and I do recommend that), you can use sp_ValidateLogins to find any logins on SQL Server that have been disabled or dropped on the Windows Active Directory side.

     

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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