• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 600
  • Last Modified:

Display hostname and username on Intranet

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
blin2000
Asked:
blin2000
  • 5
  • 2
1 Solution
 
dukestaTAICommented:
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
 
JohnBPriceCommented:
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
 
blin2000Author Commented:
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!

 
dukestaTAICommented:
Anonymous should not be checked and NT Challenge should be in order to get auth_user value
0
 
JohnBPriceCommented:
Basic authentication will also set AUTH_USER
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now