Solved

How to Retrieve User Name and Machine Name using ASP?

Posted on 2001-07-25
7
245 Views
Last Modified: 2011-09-20
I have a form to be filled by users who use Win 2000 Pro clients logged into NT domain and when submitted to be sent by email.

What I need to be included when a form is submitted to get:
1. Machine name or IP address.
2. User Name.

So, how to now the Machine name and user name of a client?
Thanks  
0
Comment
Question by:alsaeed_s
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 10

Expert Comment

by:makerp
ID: 6316795
Request.ServerVariables("REMOTE_ADDR")
Request.ServerVariables("LOGON_USER")

these two server variables are what you want

0
 

Author Comment

by:alsaeed_s
ID: 6316846
I tried them, but I get nothing!

Could you give a small example..

Thanks
0
 
LVL 10

Expert Comment

by:makerp
ID: 6316867
to use LOGON_USER the user must have logged on to your site using challenge response/basic, see IIS settings for that web site/virtual directory, if not there is no way to get their username.

try REMOTE_HOST insead of _ADDR


0
Independent Software Vendors: 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!

 

Author Comment

by:alsaeed_s
ID: 6316980
I have many virtual directories.
Which one should I check..

Please notice that I don't have that much experience in IIS, so could you please be more detailed.

Thanks
0
 
LVL 10

Accepted Solution

by:
makerp earned 50 total points
ID: 6317004
you need to go to the virtual di in question (where the scripts are) then go to security and enable basic or challenge response
0
 

Expert Comment

by:cscheepers
ID: 6317175
Just something extra - to seperate the domain and username:

Logon = Request.ServerVariables("Logon_User")

Position = InStr(1, Logon, "\")
Length = Len(Logon)
Domain = Left(Logon, Position - 1)

Position = InStr(1, Logon, "\")
Length = Len(Logon)
Username = Right(Logon, Length - Position)

Hope you can use it.
0
 

Author Comment

by:alsaeed_s
ID: 6319222
Thanks all for help.

Alsaeed
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Call a function within the ASP code 4 26
Button on Table, name table1 not working 4 34
PHP encrypted string and passing to a ASP Page 12 48
SQL to JSON 14 39
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

726 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