How to get the Windows current logged user name using ASP

Discussion in 'ASP General' started by mvr, May 16, 2006.

  1. mvr

    mvr Guest

    Hi all

    How to get the Windows current logged user name using Classic ASP.
    If no direct way are there any work arounds.

    Thanks
    mvr
     
    mvr, May 16, 2006
    #1
    1. Advertising

  2. mvr wrote:
    > Hi all
    >
    > How to get the Windows current logged user name using Classic
    > ASP. If no direct way are there any work arounds.
    >

    1. Turn off Anonymous access to your site using IIS Manager
    2. Use the LOGON_USER servervariable:
    <%
    response.write request.servervariables("LOGON_USER")
    %>

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], May 16, 2006
    #2
    1. Advertising

  3. If you have one person logged onto the console directly, and two people
    logged in through terminal services, what do you want to see? You can
    probably hook into ADSI or use WScript.Network, but I think it will require
    significantly elevated privileges (typically not recommended for a classic
    ASP application).

    One possible workaround is to use a data store for this, and have a login
    script in the startup folder that stores %USERNAME% in a table. It will be
    tougher to detect logoffs and inactive/expired sessions, of course.



    "mvr" <> wrote in message
    news:...
    > Hi all
    >
    > How to get the Windows current logged user name using Classic ASP.
    > If no direct way are there any work arounds.
    >
    > Thanks
    > mvr
    >
    >
     
    Aaron Bertrand [SQL Server MVP], May 16, 2006
    #3
  4. Silly me, I was thinking the user logged onto the machine, not the user
    requesting the web page.



    "Bob Barrows [MVP]" <> wrote in message
    news:...
    > mvr wrote:
    >> Hi all
    >>
    >> How to get the Windows current logged user name using Classic
    >> ASP. If no direct way are there any work arounds.
    >>

    > 1. Turn off Anonymous access to your site using IIS Manager
    > 2. Use the LOGON_USER servervariable:
    > <%
    > response.write request.servervariables("LOGON_USER")
    > %>
    >
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >
     
    Aaron Bertrand [SQL Server MVP], May 16, 2006
    #4
  5. :)
    You're just a little out of practice

    Aaron Bertrand [SQL Server MVP] wrote:
    > Silly me, I was thinking the user logged onto the machine, not the
    > user requesting the web page.


    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], May 16, 2006
    #5
  6. I know, what on earth am I doing here, anyway...


    "Bob Barrows [MVP]" <> wrote in message
    news:...
    > :)
    > You're just a little out of practice
     
    Aaron Bertrand [SQL Server MVP], May 16, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Dalberg
    Replies:
    6
    Views:
    21,156
    John Dalberg
    Apr 18, 2005
  2. keithb
    Replies:
    0
    Views:
    658
    keithb
    Feb 16, 2006
  3. Imran Aziz

    Get the current logged in user name

    Imran Aziz, Aug 2, 2005, in forum: ASP .Net Security
    Replies:
    8
    Views:
    236
  4. Shaminda Illangantilaka

    How can I get the current logged user information

    Shaminda Illangantilaka, Jan 4, 2006, in forum: ASP .Net Security
    Replies:
    2
    Views:
    165
    Patrick.O.Ige
    Jan 25, 2006
  5. Rodrigo Bermejo

    Windows - Get current logged user

    Rodrigo Bermejo, Sep 28, 2007, in forum: Ruby
    Replies:
    13
    Views:
    441
    Devi Web Development
    Oct 24, 2007
Loading...

Share This Page