Solved

Display hostname and username on Intranet

Posted on 2003-10-27
8
571 Views
Last Modified: 2012-06-27
I would like to display the hostname (or computername) and username (or logonID) on our Intranet support page. Can some one tell me where I can download the samples or post the code here?
 
Thanks.
 
0
Comment
Question by:blin2000
  • 5
  • 2
8 Comments
 
LVL 4

Accepted Solution

by:
dukestaTAI earned 125 total points
ID: 9628766
This code will list what you want but you have to have logging turned on in your IIS server.  Also you have to have reverse lookup enable in you DNS to get the host name or it will just give you the IP address.

<%
Response.Write Request.ServerVariables("AUTH_USER ") & "  " & Request.ServerVariables("REMOTE_HOST ")
%>

This code will list all of the possible items that you can request from Server Variables.

<%
For each item in Request.ServerVariables
     Response.Write "<li>" & item & " = " & Request.ServerVariables(item)
next
%>
0
 
LVL 16

Expert Comment

by:JohnBPrice
ID: 9628811
in ASP

<HTML>
<BODY>
Server Hostname: <%=Request.ServerVariables("SERVER_NAME")%><BR>
Client Hostname: <%=Request.ServerVariables("REMOTE_HOST")%><BR>
User: <%=Request.ServerVariables("AUTH_USER")%>
</BODY>
</HTML>

0
 
LVL 7

Author Comment

by:blin2000
ID: 9631240
Thanks you for all help. We have an internal DNS on the web server and IIS logging is enabled. The client name display ip address and user display non thing. why?
0
 
LVL 4

Expert Comment

by:dukestaTAI
ID: 9633202
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 4

Expert Comment

by:dukestaTAI
ID: 9633218
0
 
LVL 4

Expert Comment

by:dukestaTAI
ID: 9633229
0
 
LVL 4

Expert Comment

by:dukestaTAI
ID: 9633256
Anonymous should not be checked and NT Challenge should be in order to get auth_user value
0
 
LVL 16

Expert Comment

by:JohnBPrice
ID: 9633459
Basic authentication will also set AUTH_USER
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now