Link to home
Start Free TrialLog in
Avatar of rick101396
rick101396

asked on

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

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.

Avatar of rick101396
rick101396

ASKER

Edited text of question
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") %>


Avatar of sybe
You can force a login on NT by removing the NT-rights for IUSR_machinename on the directories/files.
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.
ASKER CERTIFIED SOLUTION
Avatar of mouatts
mouatts

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks,

I think I could try to understand it from here.