473,770 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

LOGON_USER & Anonymous Access

Is there a way to obtain user information (using LOGON_USER server
variables) when you have set up the security to Anonymous Access? I
have tried setting the security to both Anonymous + Window Integrated,
without any luck. I'm using IIS 6.0 on Windows Server 2003

Thanks in advance!
>bhavin
Apr 10 '07 #1
7 5356
Is there a way to obtain user information (using LOGON_USER server
variables) when you have set up the security to Anonymous Access?
No.
Apr 10 '07 #2
<bh******@gmail .comwrote in message
news:11******** *************@w 1g2000hsg.googl egroups.com...
Is there a way to obtain user information (using LOGON_USER server
variables) when you have set up the security to Anonymous Access?
No.
I have tried setting the security to both Anonymous + Window Integrated,
without any luck. I'm using IIS 6.0 on Windows Server 2003
That ought to have worked, so long as:

1) you have a Windows domain

2) your IIS machine is part of that domain

3) your client machine is part of that domain

4) your client browser is IE

5) your client machine is actually logged on to the domain, i.e. the user
hasn't logged on locally...

Other scenarios may also work, but the above certainly should...
Apr 10 '07 #3
On Apr 10, 3:31 pm, "Mark Rae" <m...@markNOSPA Mrae.netwrote:
<bhavi...@gmail .comwrote in message

news:11******** *************@w 1g2000hsg.googl egroups.com...
Is there a way to obtain user information (using LOGON_USER server
variables) when you have set up the security to Anonymous Access?

No.
I have tried setting the security to both Anonymous + Window Integrated,
without any luck. I'm using IIS 6.0 on Windows Server 2003

That ought to have worked, so long as:

1) you have a Windows domain

2) your IIS machine is part of that domain

3) your client machine is part of that domain

4) your client browser is IE

5) your client machine is actually logged on to the domain, i.e. the user
hasn't logged on locally...

Other scenarios may also work, but the above certainly should...
Hi Mark,
Thanks for your reply. I met all the criterias you listed above, but
it still doesn't work.
I tried using the same settings on IIS 5.0, and it seemed to have
worked. Doesn't seem to work with IIS 6.0.

Any idea why?

Thanks!

Apr 11 '07 #4
<bh******@gmail .comwrote in message
news:11******** **************@ n59g2000hsh.goo glegroups.com.. .
Thanks for your reply. I met all the criterias you listed above, but
it still doesn't work.
Hmmm...
I tried using the same settings on IIS 5.0, and it seemed to have
worked. Doesn't seem to work with IIS 6.0.

Any idea why?
I have to confess I'm not a networking specialist... However, Win2k3s comes
with IIS 6 straight out of the box, so when you say it works with IIS 5,
that is presumably on a Windows 2000 server, right...? IIRC, Win2k3s fully
patched has much tighter security features than Win2k, so that might be
something to look at...

Can you please take the code below and copy it exactly into an aspx page,
place that in the app running on your IIS 6 box, run it, and tell me what
the various server variables say?
<%@ Page language="c#" %>
<%@ Import Namespace="Syst em" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Debug for ASP.NET</title>
<meta name="GENERATOR " content="Micros oft Visual Studio .NET 7.1" />
<meta name="CODE_LANG UAGE" content="C#" />
<meta name="vs_defaul tClientScript" content="JavaSc ript" />
<meta name="vs_target Schema"
content="http://schemas.microso ft.com/intellisense/ie5" />
<meta http-equiv="Expires" content="0" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" />
<script type="text/javascript">
<!--
function toggleTable(pst rTable)
{
if(document.get ElementById("tb l" + pstrTable).styl e.display =="none")
{
document.getEle mentById("tbl" + pstrTable).styl e.display="bloc k";
document.getEle mentById("cmd" + pstrTable).valu e="Hide";
}
else
{
document.getEle mentById("tbl" + pstrTable).styl e.display="none ";
document.getEle mentById("cmd" + pstrTable).valu e="Show";
}
}
-->
</script>
</head>

<body>
<form id="frmDefault " runat="server">
<input type="button" id="cmdCurrentI ISContext" value="Show"
onclick="toggle Table('CurrentI ISContext');" style="width:32 pt;" />
<b>Current server context running IIS (Environment)</b>
<table id="tblCurrentI ISContext" border="1px" style="display: none;">
<tr>
<td><b>Key</b></td>
<td><b>Value</b></td>
</tr>
<!--
<tr>
<td>System.Secu rity.Principal. WindowsIdentity .GetCurrent().N ame</td>
<td><%// = System.Security .Principal.Wind owsIdentity.Get Current().Name
%></td>
</tr>
-->
<tr>
<td>System.Envi ronment.Current Directory</td>
<td><% = System.Environm ent.CurrentDire ctory.ToString( ) %></td>
</tr>
<tr>
<td>System.Envi ronment.Machine Name</td>
<td><% = System.Environm ent.MachineName .ToString() %></td>
</tr>
<tr>
<td>System.Envi ronment.OSVersi on</td>
<td>
<%
/*
4.00.1381 Windows NT 4.0
4.00.1381 Windows NT 4.0 Service Pack 6a 1999-11-30
5.00.2195 Windows 2000 (Windows NT 5.0)
5.00.2195 Windows 2000 (Windows NT 5.0) Service Pack 4 2003-06-26
5.1.2600 Windows XP (Windows NT 5.1)
5.1.2600.2096 Windows XP (Windows NT 5.1) Service Pack 2 RC1
2004-03-11
5.1.2600.2149 Windows XP (Windows NT 5.1) Service Pack 2 RC2
2004-06-10
5.2.3663 Windows Server 2003 RC1
5.2.3718 Windows Server 2003 RC2
5.2.3790 Windows Server 2003 RTM (Windows NT 5.2) 2003-04
6.0.4051 Windows "Longhorn" Client Preview 1 2003-11-02
6.0.4074 Windows "Longhorn" Client Preview 2 2004-05-04
*/
Response.Write( System.Environm ent.OSVersion.T oString());
System.Operatin gSystem osInfo = System.Environm ent.OSVersion;

switch(osInfo.P latform) // determine the platform
{
case System.Platform ID.Win32Windows : // Win95, Win98, Win98SE, WinMe
{
switch (osInfo.Version .Minor)
{
case 0:
{
Response.Write( " (Windows 95)");
break;
}
case 10:
{
if(osInfo.Versi on.Revision.ToS tring() == "2222A")
{
Response.Write( " (Windows 98 Second Edition)");
}
else
{
Response.Write( " (Windows 98)");
}
break;
}
case 90:
{
Response.Write( " (Windows Me)");
break;
}
}
break;
}
case System.Platform ID.Win32NT: // WinNT Win2k, WinXP, Win2k3,
Longhorn, Vista
{
switch(osInfo.V ersion.Major)
{
case 3:
{
Response.Write( " (Windows NT 3.51)");
break;
}
case 4:
{
Response.Write( " (Windows NT 4.0)");
break;
}
case 5:
{
switch(osInfo.V ersion.Minor)
{
case 0:
{
Response.Write( " (Windows 2000)");
break;
}
case 1:
{
Response.Write( " (Windows XP)");
break;
}
case 2:
{
switch(osInfo.V ersion.Build)
{
case 3663:
{
Response.Write( " (Windows Server 2003 RC1)");
break;
}
case 3718:
{
Response.Write( " (Windows Server 2003 RC2)");
break;
}
case 3790:
{
Response.Write( " (Windows Server 2003)");
break;
}
}
break;
}
}
break;
}
case 6:
{
switch(osInfo.V ersion.Build)
{
case 4051:
{
Response.Write( " (Windows \"Longhorn\" Client Preview 1)");
break;
}
case 4074:
{
Response.Write( " (Windows \"Longhorn\" Client Preview 2)");
break;
}
}
break;
}
default :
{
Response.Write( " (Unknown)");
break;
}
}
break;
}
}
%>
</td>
</tr>
<tr>
<td>System.Envi ronment.SystemD irectory</td>
<td><% = System.Environm ent.SystemDirec tory.ToString() %></td>
</tr>
<tr>
<td>System.Envi ronment.UserDom ainName</td>
<td><% = System.Environm ent.UserDomainN ame.ToString() %></td>
</tr>
<tr>
<td>System.Envi ronment.UserNam e</td>
<td><% = System.Environm ent.UserName.To String() %></td>
</tr>
<tr>
<td>System.Envi ronment.Version </td>
<td>
<%
Response.Write( System.Environm ent.Version.ToS tring());
switch(System.E nvironment.Vers ion.ToString())
{
case "1.0.3705.0 00" :
{
Response.Write( " (.NET 1.0)");
break;
}
case "1.0.3705.2 09" :
{
Response.Write( " (.NET 1.0 SP1)");
break;
}
case "1.0.3705.2 88" :
{
Response.Write( " (.NET 1.0 SP2)");
break;
}
case "1.0.3705.6 018" :
{
Response.Write( " (.NET 1.0 SP3)");
break;
}
case "1.1.4322.5 73" :
{
Response.Write( " (.NET 1.1)");
break;
}
case "1.1.4322.2 032" : // native
case "1.1.4322.2 300" : // included with Win2k3s 32-bit SP1
case "1.1.4322.2359" : // included with Win2k3s 32-bit SP2
{
Response.Write( " (.NET 1.1 SP1)");
break;
}
case "2.0.50727. 42":
{
Response.Write( " (.NET 2.0)");
break;
}
}
%>
</td>
</tr>
<tr>
<td>System.Envi ronment.Working Set</td>
<td><% = (System.Environ ment.WorkingSet / (1000 *
1024)).ToString ("#,###0") + "Mb (" +
System.Environm ent.WorkingSet. ToString("#,### 0") + ")" %></td>
</tr>
</table>
<hr />
<input type="button" id="cmdEnvironm ent" value="Show"
onclick="toggle Table('Environm ent');" style="width:32 pt;" />
<b>Environmen t Variables (Environment.Ge tEnvironmentVar iables())</b><br
/>
<table id="tblEnvironm ent" border="1px" style="display: none;">
<tr>
<td><b>Key</b></td>
<td><b>Value</b></td>
</tr>
<%foreach (DictionaryEntr y de in Environment.Get EnvironmentVari ables())
{%>
<tr>
<td><%= de.Key %></td>
<td><%= de.Value %></td>
</tr>
<% } %>
</table>
<hr />
<input type="button" id="cmdDNS" value="Show"
onclick="toggle Table('DNS');" style="width:32 pt;" />
<b>Dns Object (System.Net.Dns )</b><br />
<table id="tblDNS" border="1px" style="display: none;">
<tr>
<td><b>Method </b></td>
<td><b>Value</b></td>
</tr>
<tr>
<td>.GetHostNam e()</td>
<td><%= System.Net.Dns. GetHostName() %></td>
</tr>
</table>
<hr />
<input type="button" id="cmdRequest " value="Show"
onclick="toggle Table('Request' );" style="width:32 pt;" />
<b>Request Object (HttpContext.Cu rrent.Request)</b><br />
<table id="tblRequest " border="1px" style="display: none;">
<tr>
<td><b>Method </b></td>
<td><b>Value</b></td>
</tr>
<tr>
<td>.AnonymousI D</td>
<td><%= Request.Anonymo usID %>&nbsp;</td>
</tr>
<tr>
<td>.Applicatio nPath</td>
<td><%= Request.Applica tionPath %>&nbsp;</td>
</tr>
<tr>
<td>.AppRelativ eCurrentExecuti onFilePath</td>
<td><%= Request.AppRela tiveCurrentExec utionFilePath %>&nbsp;</td>
</tr>
<tr>
<td>.CurrentExe cutionFilePath</td>
<td><%= Request.Current ExecutionFilePa th %>&nbsp;</td>
</tr>
<tr>
<td>.FilePath </td>
<td><%= Request.FilePat h %>&nbsp;</td>
</tr>
<tr>
<td>.IsAuthenti cated</td>
<td><%= Request.IsAuthe nticated %>&nbsp;</td>
</tr>
<tr>
<td>.IsLocal</td>
<td><%= Request.IsLocal %>&nbsp;</td>
</tr>
<tr>
<td>.IsSecureCo nnection</td>
<td><%= Request.IsSecur eConnection %>&nbsp;</td>
</tr>
<tr>
<td>.Path</td>
<td><%= Request.Path %>&nbsp;</td>
</tr>
<tr>
<td>.PathInfo </td>
<td><%= Request.PathInf o %>&nbsp;</td>
</tr>
<tr>
<td>.PhysicalAp plicationPath</td>
<td><%= Request.Physica lApplicationPat h %>&nbsp;</td>
</tr>
<tr>
<td>.PhysicalPa th</td>
<td><%= Request.Physica lPath %>&nbsp;</td>
</tr>
<tr>
<td>.RawUrl</td>
<td><%= Request.RawUrl %>&nbsp;</td>
</tr>
<tr>
<td>.UserAgen t</td>
<td><%= Request.UserAge nt %>&nbsp;</td>
</tr>
<tr>
<td>.UserHostAd dress</td>
<td><%= Request.UserHos tAddress %></td>
</tr>
<tr>
<td>.UserHostNa me</td>
<td><%= Request.UserHos tName %></td>
</tr>
</table>
<hr />
<input type="button" id="cmdRequestS erverVariables" value="Show"
onclick="toggle Table('RequestS erverVariables' );" style="width:32 pt;" />
<b>Server Variables (HttpContext.Cu rrent.Request.S erverVariables) </b><br
/>
<table id="tblRequestS erverVariables" border="1px" style="display: none;">
<tr>
<td><b>Key</b></td>
<td><b>Value</b></td>
</tr>
<%foreach (string name in HttpContext.Cur rent.Request.Se rverVariables)
{%>
<tr>
<td><%= name %></td>
<td><%= Request.ServerV ariables[name] %>&nbsp;</td>
</tr>
<% } %>
</table>
<hr />
<input type="button" id="cmdApplicat ion" value="Show"
onclick="toggle Table('Applicat ion');" style="width:32 pt;" />
<b>Applicatio n Variables (HttpContext.Cu rrent.Applicati on)</b><br />
<table id="tblApplicat ion" border="1px" style="display: none;">
<tr>
<td><b>Key</b></td>
<td><b>Value</b></td>
</tr>
<%foreach (string name in HttpContext.Cur rent.Applicatio n) {%>
<tr>
<td><%= name %></td>
<td><%= Application[name] %></td>
</tr>
<% } %>
</table>
<hr />
<input type="button" id="cmdSession " value="Show"
onclick="toggle Table('Session' );" style="width:32 pt;" />
<b>Session Variables (HttpContext.Cu rrent.Session)</b(SessionID =
<%=Session.Sess ionID%)<br />
<table id="tblSession " border="1px" style="display: none;">
<tr>
<td><b>Key</b></td>
<td><b>Value</b></td>
</tr>
<%foreach (string name in HttpContext.Cur rent.Session) {%>
<tr>
<td><%= name %></td>
<td><%= Session[name] %></td>
</tr>
<% } %>
</table>
<hr />
<input type="button" id="cmdRequestC ookies" value="Show"
onclick="toggle Table('RequestC ookies');" style="width:32 pt;" />
<b>Cookies (HttpContext.Cu rrent.Request.C ookies)</b><br />
<table id="tblRequestC ookies" border="1px" style="display: none;">
<tr>
<td><b>Key</b></td>
<td><b>Value</b></td>
</tr>
<%foreach (string name in HttpContext.Cur rent.Request.Co okies) {%>
<tr>
<td><%= name %></td>
<td><%= Request.Cookies[name] %></td>
</tr>
<% } %>
</table>
<hr />
<%
/*
'System.Web.Htt pBrowserCapabil ities' does not contain a definition for
'GetEnumerator'
*/
%>
<input type="button" id="cmdRequestB rowser" value="Show"
onclick="toggle Table('RequestB rowser');" style="width:32 pt;" />
<b>Browser (HttpContext.Cu rrent.Request.B rowser)</b><br />
<table id="tblRequestB rowser" border="1px" style="display: none;">
<tr>
<td><b>Key</b></td>
<td><b>Value</b></td>
</tr>
<tr>
<td>.ActiveXCon trols</td>
<td><%= HttpContext.Cur rent.Request.Br owser.ActiveXCo ntrols %></td>
</tr>
<tr>
<td>.AOL</td>
<td><%= HttpContext.Cur rent.Request.Br owser.AOL %></td>
</tr>
<tr>
<td>.Background Sounds</td>
<td><%= HttpContext.Cur rent.Request.Br owser.Backgroun dSounds %></td>
</tr>
<tr>
<td>.Beta</td>
<td><%= HttpContext.Cur rent.Request.Br owser.Beta %></td>
</tr>
<tr>
<td>.Browser</td>
<td><%= HttpContext.Cur rent.Request.Br owser.Browser %></td>
</tr>
<tr>
<td>.CDF</td>
<td><%= HttpContext.Cur rent.Request.Br owser.CDF %></td>
</tr>
<tr>
<td>.ClrVersion </td>
<td><%= HttpContext.Cur rent.Request.Br owser.ClrVersio n %></td>
</tr>
<tr>
<td>.Cookies</td>
<td><%= HttpContext.Cur rent.Request.Br owser.Cookies %></td>
</tr>
<tr>
<td>.Crawler</td>
<td><%= HttpContext.Cur rent.Request.Br owser.Crawler %></td>
</tr>
<tr>
<td>.EcmaScript Version</td>
<td><%= HttpContext.Cur rent.Request.Br owser.EcmaScrip tVersion %></td>
</tr>
<tr>
<td>.Frames</td>
<td><%= HttpContext.Cur rent.Request.Br owser.Frames %></td>
</tr>
<tr>
<td>.JavaApplet s</td>
<td><%= HttpContext.Cur rent.Request.Br owser.JavaApple ts %></td>
</tr>
<tr>
<td>.JavaScript </td>
<td><%= HttpContext.Cur rent.Request.Br owser.EcmaScrip tVersion.Major >=
1 %></td>
</tr>
<tr>
<td>.MajorVersi on</td>
<td><%= HttpContext.Cur rent.Request.Br owser.MajorVers ion %></td>
</tr>
<tr>
<td>.MinorVersi on</td>
<td><%= HttpContext.Cur rent.Request.Br owser.MinorVers ion %></td>
</tr>
<tr>
<td>.MSDomVersi on</td>
<td><%= HttpContext.Cur rent.Request.Br owser.MSDomVers ion %></td>
</tr>
<tr>
<td>.Platform </td>
<td><%= HttpContext.Cur rent.Request.Br owser.Platform %></td>
</tr>
<tr>
<td>.Tables</td>
<td><%= HttpContext.Cur rent.Request.Br owser.Tables %></td>
</tr>
<tr>
<td>.Type</td>
<td><%= HttpContext.Cur rent.Request.Br owser.Type %></td>
</tr>
<tr>
<td>.VBScript </td>
<td><%= HttpContext.Cur rent.Request.Br owser.VBScript %></td>
</tr>
<tr>
<td>.Version</td>
<td><%= HttpContext.Cur rent.Request.Br owser.Version %></td>
</tr>
<tr>
<td>.W3CDomVers ion</td>
<td><%= HttpContext.Cur rent.Request.Br owser.W3CDomVer sion %></td>
</tr>
<tr>
<td>.Win16</td>
<td><%= HttpContext.Cur rent.Request.Br owser.Win16 %></td>
</tr>
<tr>
<td>.Win32</td>
<td><%= HttpContext.Cur rent.Request.Br owser.Win32 %></td>
</tr>
</table>
<hr />
<input type="button" id="cmdNavigato r" value="Show"
onclick="toggle Table('Navigato r');" style="width:32 pt;" />
<b>Navigator Properties (javascript:nav igator)</b><br />
<table id="tblNavigato r" border="1px" style="display: none;">
<tr>
<td><b>Property </b></td>
<td><b>Value</b></td>
</tr>
<tr>
<td>appCodeName </td>
<td><script
type="text/javascript">doc ument.write(nav igator.appCodeN ame);</script></td>
</tr>
<tr>
<td>appMinorVer sion</td<!--appMajorVersion doesn't exist, for some
reason!-->
<td><script
type="text/javascript">doc ument.write(nav igator.appMinor Version);</script></td>
</tr>
<tr>
<td>appName</td>
<td><script
type="text/javascript">doc ument.write(nav igator.appName) ;</script></td>
</tr>
<tr>
<td>appVersio n</td>
<td><script
type="text/javascript">doc ument.write(nav igator.appVersi on);</script></td>
</tr>
<tr>
<td>browserLang uage</td>
<td><script
type="text/javascript">doc ument.write(nav igator.browserL anguage);</script></td>
</tr>
<tr>
<td>constructor </td>
<td><script
type="text/javascript">doc ument.write(nav igator.construc tor);</script></td>
</tr>
<tr>
<td>cookieEnabl ed</td>
<td><script
type="text/javascript">doc ument.write(nav igator.cookieEn abled);</script></td>
</tr>
<tr>
<td>cpuClass</td>
<td><script
type="text/javascript">doc ument.write(nav igator.cpuClass );</script></td>
</tr>
<tr>
<td>javaEnabled ()</td>
<td><script
type="text/javascript">doc ument.write(nav igator.javaEnab led());</script></td>
</tr>
<tr>
<td>language</td>
<td><script
type="text/javascript">doc ument.write(nav igator.language );</script></td>
</tr>
<tr>
<td>onLine</td>
<td><script
type="text/javascript">doc ument.write(nav igator.onLine); </script></td>
</tr>
<tr>
<td>opsProfil e</td>
<td><script
type="text/javascript">doc ument.write(nav igator.opsProfi le);</script></td>
</tr>
<tr>
<td>platform</td>
<td><script
type="text/javascript">doc ument.write(nav igator.platform );</script></td>
</tr>
<tr>
<td>securityPol icy</td>
<td><script
type="text/javascript">doc ument.write(nav igator.security Policy);</script></td>
</tr>
<tr>
<td>systemLangu age</td>
<td><script
type="text/javascript">doc ument.write(nav igator.systemLa nguage);</script></td>
</tr>
<tr>
<td>taintEnable d()</td>
<td><script
type="text/javascript">doc ument.write(nav igator.taintEna bled());</script></td>
</tr>
<tr>
<td>userAgent </td>
<td><script
type="text/javascript">doc ument.write(nav igator.userAgen t);</script></td>
</tr>
<tr>
<td>userLanguag e</td>
<td><script
type="text/javascript">doc ument.write(nav igator.userLang uage);</script></td>
</tr>
<tr>
<td>userProfile </td>
<td><script
type="text/javascript">doc ument.write(nav igator.userProf ile);</script></td>
</tr>
</table>
<hr />
<input type="button" id="cmdScreen" value="Show"
onclick="toggle Table('Screen') ;" style="width:32 pt;" />
<b>Screen Properties (javascript:scr een)</b><br />
<table id="tblScreen" border="1px" style="display: none;">
<tr>
<td><b>Property </b></td>
<td><b>Value</b></td>
</tr>
<tr>
<td>availHeight </td>
<td><script
type="text/javascript">doc ument.write(scr een.availHeight );</script></td>
</tr>
<tr>
<td>availLeft </td>
<td><script
type="text/javascript">doc ument.write(scr een.availLeft); </script></td>
</tr>
<tr>
<td>availTop</td>
<td><script
type="text/javascript">doc ument.write(scr een.availTop);</script></td>
</tr>
<tr>
<td>availWidt h</td>
<td><script
type="text/javascript">doc ument.write(scr een.availWidth) ;</script></td>
</tr>
<tr>
<td>colorDept h</td>
<td><script
type="text/javascript">doc ument.write(scr een.colorDepth) ;</script></td>
</tr>
<tr>
<td>height</td>
<td><script
type="text/javascript">doc ument.write(scr een.height);</script></td>
</tr>
<tr>
<td>pixelDept h</td>
<td><script
type="text/javascript">doc ument.write(scr een.pixelDepth) ;</script></td>
</tr>
<tr>
<td>width</td>
<td><script
type="text/javascript">doc ument.write(scr een.width);</script></td>
</tr>
</table>
</form>
</body>
</html>
Apr 11 '07 #5
You won't get this working. If you anon and windows integrated enabled then
the browser will first issue an anon request for your page. As that request
works and there is no prompt for authentication you can't get their
credentials.

<bh******@gmail .comwrote in message
news:11******** **************@ n59g2000hsh.goo glegroups.com.. .
On Apr 10, 3:31 pm, "Mark Rae" <m...@markNOSPA Mrae.netwrote:
><bhavi...@gmai l.comwrote in message

news:11******* **************@ w1g2000hsg.goog legroups.com...
Is there a way to obtain user information (using LOGON_USER server
variables) when you have set up the security to Anonymous Access?

No.
I have tried setting the security to both Anonymous + Window
Integrated,
without any luck. I'm using IIS 6.0 on Windows Server 2003

That ought to have worked, so long as:

1) you have a Windows domain

2) your IIS machine is part of that domain

3) your client machine is part of that domain

4) your client browser is IE

5) your client machine is actually logged on to the domain, i.e. the user
hasn't logged on locally...

Other scenarios may also work, but the above certainly should...

Hi Mark,
Thanks for your reply. I met all the criterias you listed above, but
it still doesn't work.
I tried using the same settings on IIS 5.0, and it seemed to have
worked. Doesn't seem to work with IIS 6.0.

Any idea why?

Thanks!

Apr 11 '07 #6
On Apr 11, 1:18 pm, "Mark Rae" <m...@markNOSPA Mrae.netwrote:
<bhavi...@gmail .comwrote in message

news:11******** **************@ n59g2000hsh.goo glegroups.com.. .
Thanks for your reply. I met all the criterias you listed above, but
it still doesn't work.

Hmmm...
I tried using the same settings on IIS 5.0, and it seemed to have
worked. Doesn't seem to work with IIS 6.0.
Any idea why?

I have to confess I'm not a networking specialist... However, Win2k3s comes
with IIS 6 straight out of the box, so when you say it works with IIS 5,
that is presumably on a Windows 2000 server, right...? IIRC, Win2k3s fully
patched has much tighter security features than Win2k, so that might be
something to look at...

Can you please take the code below and copy it exactly into an aspx page,
place that in the app running on your IIS 6 box, run it, and tell me what
the various server variables say?

<%@ Page language="c#" %>
<%@ Import Namespace="Syst em" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Debug for ASP.NET</title>
<meta name="GENERATOR " content="Micros oft Visual Studio .NET 7.1" />
<meta name="CODE_LANG UAGE" content="C#" />
<meta name="vs_defaul tClientScript" content="JavaSc ript" />
<meta name="vs_target Schema"
content="http://schemas.microso ft.com/intellisense/ie5" />
<meta http-equiv="Expires" content="0" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" />
<script type="text/javascript">
<!--
function toggleTable(pst rTable)
{
if(document.get ElementById("tb l" + pstrTable).styl e.display =="none")
{
document.getEle mentById("tbl" + pstrTable).styl e.display="bloc k";
document.getEle mentById("cmd" + pstrTable).valu e="Hide";
}
else
{
document.getEle mentById("tbl" + pstrTable).styl e.display="none ";
document.getEle mentById("cmd" + pstrTable).valu e="Show";
}
}
-->
</script>
</head>

<body>
<form id="frmDefault " runat="server">
<input type="button" id="cmdCurrentI ISContext" value="Show"
onclick="toggle Table('CurrentI ISContext');" style="width:32 pt;" />
<b>Current server context running IIS (Environment)</b>
<table id="tblCurrentI ISContext" border="1px" style="display: none;">
<tr>
<td><b>Key</b></td>
<td><b>Value</b></td>
</tr>
<!--
<tr>
<td>System.Secu rity.Principal. WindowsIdentity .GetCurrent().N ame</td>
<td><%// = System.Security .Principal.Wind owsIdentity.Get Current().Name
%></td>
</tr>
-->
<tr>
<td>System.Envi ronment.Current Directory</td>
<td><% = System.Environm ent.CurrentDire ctory.ToString( ) %></td>
</tr>
<tr>
<td>System.Envi ronment.Machine Name</td>
<td><% = System.Environm ent.MachineName .ToString() %></td>
</tr>
<tr>
<td>System.Envi ronment.OSVersi on</td>
<td>
<%
/*
4.00.1381 Windows NT 4.0
4.00.1381 Windows NT 4.0 Service Pack 6a 1999-11-30
5.00.2195 Windows 2000 (Windows NT 5.0)
5.00.2195 Windows 2000 (Windows NT 5.0) Service Pack 4 2003-06-26
5.1.2600 Windows XP (Windows NT 5.1)
5.1.2600.2096 Windows XP (Windows NT 5.1) Service Pack 2 RC1
2004-03-11
5.1.2600.2149 Windows XP (Windows NT 5.1) Service Pack 2 RC2
2004-06-10
5.2.3663 Windows Server 2003 RC1
5.2.3718 Windows Server 2003 RC2
5.2.3790 Windows Server 2003 RTM (Windows NT 5.2) 2003-04
6.0.4051 Windows "Longhorn" Client Preview 1 2003-11-02
6.0.4074 Windows "Longhorn" Client Preview 2 2004-05-04
*/
Response.Write( System.Environm ent.OSVersion.T oString());
System.Operatin gSystem osInfo = System.Environm ent.OSVersion;

switch(osInfo.P latform) // determine the platform
{
case System.Platform ID.Win32Windows : // Win95, Win98, Win98SE, WinMe
{
switch (osInfo.Version .Minor)
{
case 0:
{
Response.Write( " (Windows 95)");
break;
}
case 10:
{
if(osInfo.Versi on.Revision.ToS tring() == "2222A")
{
Response.Write( " (Windows 98 Second Edition)");
}
else
{
Response.Write( " (Windows 98)");
}
break;
}
case 90:
{
Response.Write( " (Windows Me)");
break;
}
}
break;
}
case System.Platform ID.Win32NT: // WinNT Win2k, WinXP, Win2k3,
Longhorn, Vista
{
switch(osInfo.V ersion.Major)
{
case 3:
{
Response.Write( " (Windows NT 3.51)");
break;
}
case 4:
{
Response.Write( " (Windows NT 4.0)");
break;
}
case 5:
{
switch(osInfo.V ersion.Minor)
{
case 0:
{
Response.Write( " (Windows 2000)");
break;
}
case 1:
{
Response.Write( " (Windows XP)");
break;
}
case 2:
{
switch(osInfo.V ersion.Build)
{
case 3663:
{
Response.Write( " (Windows Server 2003 RC1)");
break;
}
case 3718:
{
Response.Write( " (Windows Server 2003 RC2)");
break;
}
case 3790:
{
Response.Write( " (Windows Server 2003)");
break;
}
}
break;
}
}
break;
}
case 6:
{
switch(osInfo.V ersion.Build)
{
case 4051:
{
Response.Write( " (Windows \"Longhorn\" Client Preview 1)");
break;
}
case 4074:
{
Response.Write( " (Windows \"Longhorn\" Client Preview 2)");
break;
}
}
break;
}
default :
{
Response.Write( " (Unknown)");
break;
}
}
break;
}
}
%>
</td>
</tr>
<tr>
<td>System.Envi ronment.SystemD irectory</td>
<td><% = System.Environm ent.SystemDirec tory.ToString() %></td>
</tr>
<tr>
<td>System.Envi ronment.UserDom ainName</td>
<td><% = System.Environm ent.UserDomainN ame.ToString() %></td>
</tr>
<tr>
<td>System.Envi ronment.UserNam e</td>
<td><% = System.Environm ent.UserName.To String() %></td>
</tr>
<tr>
<td>System.Envi ronment.Version </td>
<td>
<%
Response.Write( System.Environm ent.Version.ToS tring());
switch(System.E nvironment.Vers ion.ToString())
{
case "1.0.3705.0 00" :
{
Response.Write( " (.NET 1.0)");
break;
}
case "1.0.3705.2 09" :
{
Response.Write( " (.NET 1.0 SP1)");
break;
}
case "1.0.3705.2 88" :
{
Response.Write( " (.NET 1.0 SP2)");
break;
}
case "1.0.3705.6 018" :
{
Response.Write( " (.NET 1.0 SP3)");
break;
}
case "1.1.4322.5 73" :
{
Response.Write( " (.NET 1.1)");
break;
}
case "1.1.4322.2 032" : // native
case "1.1.4322.2 300" : // included with Win2k3s 32-bit SP1
case "1.1.4322.2359" : // included with Win2k3s 32-bit SP2
{
Response.Write( " (.NET 1.1 SP1)");
break;
}
case "2.0.50727. 42":
{
Response.Write( " (.NET 2.0)");
break;
}
}
%>
</td>
</tr>
<tr>
<td>System.Envi ronment.Working Set</td>
<td><% = (System.Environ ment.WorkingSet / (1000 *
1024)).ToString ("#,###0") + "Mb (" +
System.Environm ent.WorkingSet. ToString("#,### 0") + ")" %></td>
</tr>
</table>
<hr />
<input type="button" id="cmdEnvironm ent" value="Show"
onclick="toggle Table('Environm ent');" style="width:32 pt;" />
<b>Environmen t Variables (Environment.Ge tEnvironmentVar iables())</b><br
/>
<table id="tblEnvironm ent" border="1px" style="display: none;">
<tr>
<td><b>Key</b></td>
<td><b>Value</b></td>
</tr>
<%foreach (DictionaryEntr y de in Environment.Get EnvironmentVari ables())
{%>
<tr>
<td><%= de.Key %></td>
<td><%= de.Value %></td>
</tr>
<% } %>
</table>
<hr />
<input type="button" id="cmdDNS" value="Show"
onclick="toggle Table('DNS');" style="width:32 pt;" />
<b>Dns Object (System.Net.Dns )</b><br />
<table id="tblDNS" border="1px" style="display: none;">
<tr>
<td><b>Method </b></td>
<td><b>Value</b></td>
</tr>
<tr>
<td>.GetHostNam e()</td>
<td><%= System.Net.Dns. GetHostName() %></td>
</tr>
</table>
<hr />
<input type="button" id="cmdRequest " value="Show"
onclick="toggle Table('Request' );" style="width:32 pt;" />
<b>Request Object (HttpContext.Cu rrent.Request)</b><br />
<table id="tblRequest " border="1px" style="display: none;">
<tr>
<td><b>Method </b></td>
<td><b>Value</b></td>
</tr>
<tr>
<td>.AnonymousI D</td>
<td><%= Request.Anonymo usID %>&nbsp;</td>
</tr>
<tr>
<td>.Applicatio nPath</td>
<td><%= Request.Applica tionPath %>&nbsp;</td>
</tr>
<tr>
<td>.AppRelativ eCurrentExecuti onFilePath</td>
<td><%= Request.AppRela tiveCurrentExec utionFilePath %>&nbsp;</td>
</tr>
<tr>
<td>.CurrentExe cutionFilePath</td>
<td><%= Request.Current ExecutionFilePa th %>&nbsp;</td>
</tr>
<tr>
<td>.FilePath </td>
<td><%= Request.FilePat h %>&nbsp;</td>
</tr>
<tr>
<td>.IsAuthenti cated</td>
<td><%=
...

read more »
Hi Mark,
Thanks for your help!. Here's what I see (I have replaced few details
with XXXXXXXXXX):

Key Value
ALL_HTTP HTTP_CONNECTION :Keep-Alive HTTP_ACCEPT:*/*
HTTP_ACCEPT_ENC ODING:gzip, deflate HTTP_ACCEPT_LAN GUAGE:en-us
HTTP_HOST: XXXXXXXXXXXXX HTTP_USER_AGENT :Mozilla/4.0 (compatible; MSIE
6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR
2.0.50727)
ALL_RAW Connection: Keep-Alive Accept: */* Accept-Encoding: gzip,
deflate Accept-Language: en-us Host: XXXXXXXXXXXXX User-Agent: Mozilla/
4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322;
InfoPath.1; .NET CLR 2.0.50727)
APPL_MD_PATH /LM/W3SVC/1/Root/TestGoogleGroup
APPL_PHYSICAL_P ATH D:\Projects\Tes tGoogleGroup\
AUTH_TYPE
AUTH_USER
AUTH_PASSWORD
LOGON_USER
REMOTE_USER
CERT_COOKIE
CERT_FLAGS
CERT_ISSUER
CERT_KEYSIZE
CERT_SECRETKEYS IZE
CERT_SERIALNUMB ER
CERT_SERVER_ISS UER
CERT_SERVER_SUB JECT
CERT_SUBJECT
CONTENT_LENGTH 0
CONTENT_TYPE
GATEWAY_INTERFA CE CGI/1.1
HTTPS off
HTTPS_KEYSIZE
HTTPS_SECRETKEY SIZE
HTTPS_SERVER_IS SUER
HTTPS_SERVER_SU BJECT
INSTANCE_ID 1
INSTANCE_META_P ATH /LM/W3SVC/1
LOCAL_ADDR XXXXXXXXXXXXX
PATH_INFO /testgooglegroup/default.aspx
PATH_TRANSLATED D:\Projects\Tes tGoogleGroup\de fault.aspx
QUERY_STRING
REMOTE_ADDR XXXXXXXXXXXXX
REMOTE_HOST XXXXXXXXXXXXX
REMOTE_PORT XXXXXXXXXXXXX
REQUEST_METHOD GET
SCRIPT_NAME /testgooglegroup/default.aspx
SERVER_NAME XXXXXXXXXXXXX
SERVER_PORT 80
SERVER_PORT_SEC URE 0
SERVER_PROTOCOL HTTP/1.1
SERVER_SOFTWARE Microsoft-IIS/6.0
URL /testgooglegroup/default.aspx
HTTP_CONNECTION Keep-Alive
HTTP_ACCEPT */*
HTTP_ACCEPT_ENC ODING gzip, deflate
HTTP_ACCEPT_LAN GUAGE en-us
HTTP_HOST XXXXXXXXXXXXX
HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)

Apr 13 '07 #7
<bh******@gmail .comwrote in message
news:11******** *************@y 5g2000hsa.googl egroups.com...
Thanks for your help!. Here's what I see (I have replaced few details
with XXXXXXXXXX):
Hmm - I'm running out of ideas now... Could it be a firewall issue...?
Apr 13 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6217
by: Maria | last post by:
I'm trying to get the NT login id of a user on a web page without making the user type it into a login box. I'm using the LOGON_USER server variable. The problem is, if the web page allows anonymous access, LOGON_USER returns nothing. If the page is set to Basic Security, the NT login popup box comes up, even though the user is already logged into the network, and HAS access to this page. Moreover, if I try this on my PC instead of our...
1
8015
by: David Chase | last post by:
I am trying to retrieve the LOGON_USER and it comes up blank. Below is my code: struser = Request.ServerVariables("LOGON_USER") Can anyone help? I need to validate internal people on out intranet. Thanks. David
1
3330
by: Amitava Bardhan | last post by:
Request.servervariables("Logon_USer") is working perfectly well for one asp page returning the NT userid as expected but returning an empty string for another asp page.Both the asp pages are in the same directory.This directory have both Anonymous Access and Integrated Authentication enabled att IIS. Any suggestion regarding this peculiar behaviour will be very much appreciated.
1
1988
by: Li Pang | last post by:
Hi, I create a web site in a Windows 2003 server/IIS6, and I used asp pages to get ServerVariables. After I set FrontPage Extension 2002, some ServerVariables like LOGON_USER become null. Any body has an idea?
5
4402
by: T. | last post by:
Hello, I'm trying to pull the logon user's name using Request.ServerVariables("LOGON_USER")...which is returning nothing...so I need help in determining why it's returning nothing, or I need the format in which it returns the username so that I can hard code it. Does it return anything with the username? Thanks...
1
1902
by: Amitava Bardhan | last post by:
Request.servervariables("Logon_user") returns and empty string on one asp page but works perfectly well returning the NT user id on the other asp page. Both the pages are in the same directory. This directory has both Anonymous Access and Integrated Authentication enabled at the IIS.
0
1523
by: Amitava Bardhan | last post by:
Request.servervariable("Logon_User") working perfectly well returning the NT userid on one asp page but returning an empty string on the other asp page though both the asp pages are in the same directory. This directory has Anonymous access and Integrated Windows Authentication enabled in IIS
0
3951
by: Mark Rae | last post by:
Hi, I apologise that this isn't *specifically* an ASP.NET issue - I will also post it to the IIS newsgroup - but I thought I'd ask here anyway on the off-chance that someone may have come across this before... It's an intranet system written in ASP.NET v1.1 using C#. The site is running on IIS6 on Win2k3S with all the SPs and patches etc. The Session_Start interrogates the AUTH_USER server variable to identify the
2
3348
by: lmlaster | last post by:
I have 2 webs under my default web running win2003 1. A front-page intranet 2. A asp (not .net) web is fine Both allow anonomous access. My front page web always gets a BLANK Request.ServerVariables("Logon_User"). The asp web gets the logon_user OK. Both webs have a global.asa that has Sub Session_Onstart() session("logon") = Request.ServerVariables("Logon_User")
0
10259
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9906
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.