Solved

How to Retrieve User Name and Machine Name using ASP?

Posted on 2001-07-25
7
239 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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 …
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 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

18 Experts available now in Live!

Get 1:1 Help Now