Solved

Display hostname and username on Intranet

Posted on 2003-10-27
8
580 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
Industry Leaders: 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!

 
LVL 4

Expert Comment

by:dukestaTAI
ID: 9633202
0
 
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

Industry Leaders: 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!

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
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 …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

685 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