Solved

How to Retrieve User Name and Machine Name using ASP?

Posted on 2001-07-25
7
240 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
  • 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

930 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

11 Experts available now in Live!

Get 1:1 Help Now