• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2830
  • Last Modified:

Windows Server 2012 - Request.ServerVariables("LOGON_USER") does not work

Hi Experts,
I moved my site to Windows Server 2012 and now I can't capture the LOGON_USER.
This worked fine in the past, but since the site is on the new server it won't return anything:

<%=Request.ServerVariables("LOGON_USER")%>

Perhaps I have to change something in the IIS Manager.
I'd really appreciate your help.
0
romsom
Asked:
romsom
  • 6
  • 6
1 Solution
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
you have authentication mode set to windows in IIS?
0
 
romsomAuthor Commented:
Where do I have to set the authentication mode to windows?
When I double click "Authentication" I can see that the status of Anonymous Authentication is Enabled and ASP.NET Impersonation is Disabled.
No other options there.
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
is this iis 7.5?
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell┬« is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
romsomAuthor Commented:
It is IIS 8
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
0
 
romsomAuthor Commented:
No matter how many times I try getting to the "Turn Windows features on or off" screen, I always get directed to the "Add Roles and Features Wizard".
I can't get to the third screenshot (Windows Features), where Internet Information Services is highlighted in yellow.
Instead I get redirected to the "Add Roles and Features Wizard". Maybe I have to add other roles and features to be able to view Windows Features?
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
my bad, that was windows 8 (yuck!)...try this

http://msdn.microsoft.com/en-us/library/hh167503(v=nav.71).aspx

scroll down about 3/4 a way down for windows server 2012
0
 
romsomAuthor Commented:
I finally was able to get there and check Windows Authentication. Unfortunately this didn't help either. I even restarted the server, but nothing changed.
Request.ServerVariables("LOGON_USER") doesn't display anything. When I try the following I get the 401 Error:

<%
If Request.ServerVariables("LOGON_USER") = "" Then
Response.Status = "401 Access Denied"
Response.End
End If
%>

<%=Request.ServerVariables("LOGON_USER")%>
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
did you set it to windows authentication after you installed it?
0
 
romsomAuthor Commented:
I finally was able to get there and check Windows Authentication.

Under Sites Windows Authentication showed up and I enabled it. Now it's working, thank you very much for your help.
0
 
romsomAuthor Commented:
Thank you very much, it's finally working!
0
 
shivaji akarsheCommented:
Hi

Sorry to post old question,

Windows Server 2012 - Request.ServerVariables("LOGON_USER") does not work me too.

I have tried all the settings in Authentication. Anonymous is disable Windows Authentication enabled
but  Request.ServerVariables("LOGON_USER") is still empty for me. :(
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
@Shivaji - There are times when LOGIN_USER will come up empty, if you're going through a proxy and other certain network configurations (I can't remember the specifics at this time).

I recommend opening a new question so that more experts will see it and provide answers for you.

in the meantime, you can try googling:

Request.ServerVariables("LOGON_USER") will come up empty
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

  • 6
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now