?
Solved

request.ServerVariables("LOGON_USER") doesn't work

Posted on 1998-11-30
6
Medium Priority
?
1,006 Views
Last Modified: 2012-06-22
Hi

I tried using the command :

<%=request.ServerVariables("LOGON_USER")%>

in my script but it only give me an empty string.  Is there some variable that I must declare or create in order to display the server  environment variable?  

I appreciate any help to get the script to work. Thank you.

0
Comment
Question by:rick101396
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 

Author Comment

by:rick101396
ID: 1840107
Edited text of question
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1840108
To use the LOGON_USER, the user must actually log in to the NT server.  Therefore you would have to have a profile set up for that user.  the other variables will work fine.

ie:
<%=Request.ServerVariables("HTTp_REMOTEHOST") %>


0
 
LVL 28

Expert Comment

by:sybe
ID: 1840109
You can force a login on NT by removing the NT-rights for IUSR_machinename on the directories/files.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:rick101396
ID: 1840110
MasseyM:

The code that I tried to execute didn't give me the user names.  What I want to do is be able to get the logon user name and redirect them different web page if they proper access.  

<html> <head><title>New Page </title></head>
<body>
<p>User Name: <%=request.ServerVariables("LOGON_USER")%> </p>
<p>Remote User: <%=request.ServerVariables("HTTP_REMOTEHOST")%> </p>
</body>
</html>

I tried view the page with the codes (above) on both my computer and on another computer on the Intranet, but I am not getting anything for the script except empty strings.  What I am running on my workstation is IIS 4 with ASP.  Could it be because I am missing something?

Thanks.
0
 
LVL 11

Accepted Solution

by:
mouatts earned 150 total points
ID: 1840111
Firstly HTTP_REMOTEHOST should read REMOTE_HOST.

But I'm not sure that this is what you want as it does not always contain the name of the remote computer as it can contain the IP address of this machine.

As has been said before the LOGON_USER is not normally established unless a logon has occurred.

To get a better idea of what variables are being set in your particular case try running the script below.

<HTML>
<HEAD>
<TITLE>HTTP Variables</TITLE>
</HEAD>
<BODY><H1>HTTP SERVER VARIABLES></H1>
<TABLE>
<TR><TD><B>Server Variable</B></TD><TD><B>Value</B></TD></TR>
<% For Each name In Request.ServerVariables %>
<TR><TD> <%= name %> </TD><TD>  <%= Request.ServerVariables(name) %> </TD></TR>
<% Next %>
</TABLE>

 
</BODY></HTML>

Steve
0
 

Author Comment

by:rick101396
ID: 1840112
Thanks,

I think I could try to understand it from here.


0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question