How to find Domain User Name connect to Database through Application

  • How to find Application Users from database side (we are using EMPID's that are domain users). These users are longing to Application.

    when i checked from Database, there is showing only one user that is used in Connection string of application for every user process whoever connected to Database through application.

    any suggestions would be appreciate.

  • you cannot detect the end user's domain account directly.

    maybe you could loosely infer it.

    because your application is using a "common" login, only the application knows who it is;

    if you can modify the application, you can start adding a log or something to capture this information.

    you'll see a lot of people might modify their application to also echo the domain account into updates to CreatedBy or UpdatedBy columns.

    to loosely infer it, you can use powershell to get a list of all computers, and the last person to login to that computer, and stuff that into a table for reference....since most people only use a single machine at their job, finding computer/user pairs lets you infer that Dev223=mydomian\Lowell, which is a pretty good approximation of the actual user.

    then , hopefully, the application is passing the hostname to the connection string, so you could join hostname to computer name, and infer the user.

    I've used this exact method to detect when a sql user was used by a developer to connect in a server login trigger

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 2 posts - 1 through 1 (of 1 total)

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