Dear gurus!
When an employee logs on to our intranet site, I need to capture his/her username.
Can you please tell me how to do this?
A script would be great.
This is very urgent, please help!!!
What are you using to allow them to logon? ASP page, Default NT logon, Client side script...?
Do you want this stored in a database, text file, fortune cookie...?
The more specific the better we can anser
-tarwn ------------ My Little Dictionary ---------
Reverse Engineering - The expensive solution to not paying for proper documentation
Tarwn, thanks for your response.
The employees will be logging in with their system Ids (windows xp).
I just need to find a way to capture their username after they login.
I probably will prefer to store it in a textfile.
thx,
If you want there actual name you'll need to register the active directory services interface dll on your web server. You can download it from Microsoft if it isn't already registered.
Then you can get there name using this:
UserName= Replace(Request.ServerVariables("LOGON_USER","\","/"
set User = GetObject("WinNT://" & UserName)
strmyfullName = User.FullName
strmyfullName will now contain (example) "Smith, John"
when I put this code at the top of my asp code,
how do I know that it is doing what it is supposed to do?
Thanks in advance!!
<%
'------------------------------------------
' Get the USERNAME from the environment
'------------------------------------------
dim s_username
s_username = Request.ServerVariables("LOGON_USER"
%>
write it
response.write s_username
to test Not everything you type is understanding to others! Think about that before getting upset with a wrong answer to your question.
onpnt, I am sorry if I sounded upset.
I was NOT upset when I sent the thread.
I can't be upset when I am asking folks like you to help me.
Further, I have been getting pretty fast and accurate responses from you guys so I was not upset at all.
I wasn't even frustrated.
samosa, that wasn't meant towards you. it's a signature.
I think I need to take hat one off Not everything you type is understanding to others! Think about that before getting upset with a wrong answer to your question.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.