Reading USER on winNT network 
Author Message
 Reading USER on winNT network

Can javascript access the logon ID of the current user.

I want to run an intranet site on a companies network.
They use Windows NT4 and IIS.

How can I read the NT network login ID of an employee?.

The intranet site doesn't have a seperate login

Regards
Steve



Sun, 20 Jul 2003 11:55:44 GMT  
 Reading USER on winNT network
Steve,

If you can't find a JavaScript method, you can use ASP code to get what you
want. Include the following code at the top of the page (the page has to be
saved with a ".ASP" extension)

<%
strUserCreds = Request.ServerVariables("LOGON_USER")
intPos = InStr(strUserCreds, "/")
If intPos = 0 Then
   intPos = InStr(strUserCreds, "\")
End If
If intPos <> 0 Then
   strDomain = Left(strUserCreds, iPos - 1)
   strUserId = Mid(strUserCreds, iPos + 1)
Else
   strDomain = ""
   strUserId = strUserCreds
End If
%>

And access the details in javascript as follows:

function showUser() {
    alert("Domain: <%=strDomain%>");
    alert("UserId: <%=strUserId%>");

Quote:
}

Oh - just remembered - this won't work on anonymous sites: NT
Challenge/Response works best.

HTH

Tony Spratt
JLT Management Services


Quote:
> Can javascript access the logon ID of the current user.

> I want to run an intranet site on a companies network.
> They use Windows NT4 and IIS.

> How can I read the NT network login ID of an employee?.

> The intranet site doesn't have a seperate login

> Regards
> Steve



Sun, 20 Jul 2003 19:55:17 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. WinNT provider: rename user

2. Verifying The Existence of A WinNT User

3. Giving a user the right to log on as a service in WinNT

4. Adding a user to a group on WinNT

5. WinNT provider: rename user

6. Create WinNT Domain Users

7. Create WinNT Domain Users

8. WinNT provider: rename user

9. WinNT provider: rename user

10. set user.homedrive for WINNT 4 domain

11. Getting WinNT 4 User's domain properties

12. Verifying The Existence of A WinNT User

 

 
Powered by phpBB® Forum Software