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