Solved

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

Posted on 2013-11-22
13
2,490 Views
Last Modified: 2016-01-27
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
Comment
Question by:romsom
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
13 Comments
 
LVL 33

Expert Comment

by:Big Monty
ID: 39669349
you have authentication mode set to windows in IIS?
0
 

Author Comment

by:romsom
ID: 39669373
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
 
LVL 33

Expert Comment

by:Big Monty
ID: 39669378
is this iis 7.5?
0
Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

 

Author Comment

by:romsom
ID: 39669390
It is IIS 8
0
 
LVL 33

Expert Comment

by:Big Monty
ID: 39669403
0
 

Author Comment

by:romsom
ID: 39669535
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
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 total points
ID: 39669657
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
 

Author Comment

by:romsom
ID: 39669808
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
 
LVL 33

Expert Comment

by:Big Monty
ID: 39669819
did you set it to windows authentication after you installed it?
0
 

Author Comment

by:romsom
ID: 39669825
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
 

Author Closing Comment

by:romsom
ID: 39669829
Thank you very much, it's finally working!
0
 

Expert Comment

by:shivaji akarshe
ID: 41435069
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
 
LVL 33

Expert Comment

by:Big Monty
ID: 41435319
@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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
Resolve DNS query failed errors for Exchange
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
This tutorial will walk an individual through the process of installing of Data Protection Manager on a server running Windows Server 2012 R2, including the prerequisites. Microsoft .Net 3.5 is required. To install this feature, go to Server Manager…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question