How to get username on IIS run intranet (ASP)

Discussion in 'ASP General' started by Primoz Bradac, Aug 12, 2008.

  1. I have a .ASP page I'd like to make accessible only to selected users
    who are logged on Windows workstations. The .ASP page is running under
    IIS on a Windows 2003 Server (intranet).

    Is there a way I could get to the username who requested the ASP page
    (in the script of the .ASP page)?

    TIA,
    Primoz
    Primoz Bradac, Aug 12, 2008
    #1
    1. Advertising

  2. Primoz Bradac

    Evertjan. Guest

    Primoz Bradac wrote on 12 aug 2008 in
    microsoft.public.inetserver.asp.general:

    > I have a .ASP page I'd like to make accessible only to selected users
    > who are logged on Windows workstations. The .ASP page is running under
    > IIS on a Windows 2003 Server (intranet).
    >
    > Is there a way I could get to the username who requested the ASP page
    > (in the script of the .ASP page)?


    The user browser usually has no access to the settings of that
    pc/workstation, and the ASP runs on the server with it's own autorisation,
    independent of the windows autorisation of the user.

    Better do a seperate login, or check the local ip.


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Aug 12, 2008
    #2
    1. Advertising

  3. In article <Xns9AF875FD57E66eejj99@194.109.133.242>,
    says...
    > the windows autorisation of the user
    >

    Thank you Evertjan for your answer!

    My question was a little unclear. Of course server script can't access
    workstation data. I just wondered if there is some "magic" way (eg. by
    client script) to access user data in an *intranet* environment.

    I'll go the separate login way...

    Primoz
    Primoz Bradac, Aug 12, 2008
    #3
  4. Primoz Bradac wrote:
    > I have a .ASP page I'd like to make accessible only to selected users
    > who are logged on Windows workstations. The .ASP page is running under
    > IIS on a Windows 2003 Server (intranet).
    >
    > Is there a way I could get to the username who requested the ASP page
    > (in the script of the .ASP page)?
    >

    Of course there is. Use IIS Manager to turn off Anonymous Access and turn on
    Integrated Security (this is done on the Directory Security tab of the
    website Property pages, using the Edit button in the Anonymous Access and
    authentication control section).

    Once y9ou have done this, the user name will be in the LOGON_USER
    servervariable:

    Response.Write Request.ServerVariables("LOGON_USER")

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Aug 12, 2008
    #4
  5. Primoz Bradac

    Evertjan. Guest

    Bob Barrows [MVP] wrote on 12 aug 2008 in
    microsoft.public.inetserver.asp.general:

    > Primoz Bradac wrote:
    >> I have a .ASP page I'd like to make accessible only to selected users
    >> who are logged on Windows workstations. The .ASP page is running
    >> under IIS on a Windows 2003 Server (intranet).
    >>
    >> Is there a way I could get to the username who requested the ASP page
    >> (in the script of the .ASP page)?
    >>

    > Of course there is. Use IIS Manager to turn off Anonymous Access and
    > turn on Integrated Security (this is done on the Directory Security
    > tab of the website Property pages, using the Edit button in the
    > Anonymous Access and authentication control section).
    >
    > Once y9ou have done this, the user name will be in the LOGON_USER
    > servervariable:
    >
    > Response.Write Request.ServerVariables("LOGON_USER")


    While this is true, Bob,
    I doubt if Primoz wants to change the whole IIS server,
    [as this will prohibit any anonimous pages, meseems?]
    but maybe I read the intentions wrongly.



    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Aug 12, 2008
    #5
  6. Evertjan. wrote:
    > Bob Barrows [MVP] wrote on 12 aug 2008 in
    > microsoft.public.inetserver.asp.general:
    >
    >> Primoz Bradac wrote:
    >>> I have a .ASP page I'd like to make accessible only to selected
    >>> users who are logged on Windows workstations. The .ASP page is
    >>> running under IIS on a Windows 2003 Server (intranet).
    >>>
    >>> Is there a way I could get to the username who requested the ASP
    >>> page (in the script of the .ASP page)?
    >>>

    >> Of course there is. Use IIS Manager to turn off Anonymous Access and
    >> turn on Integrated Security (this is done on the Directory Security
    >> tab of the website Property pages, using the Edit button in the
    >> Anonymous Access and authentication control section).
    >>
    >> Once y9ou have done this, the user name will be in the LOGON_USER
    >> servervariable:
    >>
    >> Response.Write Request.ServerVariables("LOGON_USER")

    >
    > While this is true, Bob,
    > I doubt if Primoz wants to change the whole IIS server,
    > [as this will prohibit any anonimous pages, meseems?]
    > but maybe I read the intentions wrongly.
    >

    I left out the part where he should change the properties of the
    specific website ... sorry.

    --
    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], Aug 12, 2008
    #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. Leo Violette
    Replies:
    2
    Views:
    502
    Leo Violette
    Apr 21, 2009
  2. francan

    Fetch Intranet username

    francan, May 15, 2009, in forum: Java
    Replies:
    1
    Views:
    607
    Arne Vajhøj
    May 15, 2009
  3. Shailesh Patel
    Replies:
    0
    Views:
    436
    Shailesh Patel
    Nov 8, 2006
  4. Bob Lin
    Replies:
    6
    Views:
    307
    Bob Lin
    Oct 29, 2003
  5. Whitney
    Replies:
    2
    Views:
    259
    Ivan Marsh
    Jul 28, 2004
Loading...

Share This Page