Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get user name and from Client machine

Status
Not open for further replies.

enak

Programmer
Jul 2, 2002
412
0
0
US
I need to get the user name of the person that is logged into a network from a client machine. This is for an intranet. I have the following code:

Dim objNet
Set objNet = CreateObject("WScript.NetWork")
session("UserName")=objNet.UserName

However, this gives me the name that is logged into the web server i.e. IUSR_SERVERNAME

How can I get the user name of the person logged into the network or even the client machine?

TIA
Nate
 
I am not sure I understand your question. I had the same problem, but I only needed the login username, so I simply used the RIGHT function and kept everthing on the right of the underscore.

Are you saying you need their full name?

Denis
 
I think that I got it figured out. Thanks for your response.

Nate
 
Can you please explain how you obtained the user name? I am running into a similar issue, but I have been unable to figure it out.

For clarification, I am attempting to get the username of the logged on user on a server. The user is not logged on interactively... they are authenticating across the network. createObject("WScript.Network") isn't working for me. Is there another way of doing this?
 
arUser = split(Request.ServerVariables("LOGON_USER"), "\")
session("UserName")=arUser(1)

I fill an array with the data returned from the request. The first element (0) is the machine name and the second (1) is the user name.

Also, I had to set the security on the site folder (I did this through IIS) so that it uses windows authentication.

HTH

Nate
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top