Solved

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

Posted on 2013-11-22
13
2,257 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
  • 6
  • 6
13 Comments
 
LVL 32

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 32

Expert Comment

by:Big Monty
ID: 39669378
is this iis 7.5?
0
 

Author Comment

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

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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 32

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 32

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 32

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

The reason that corporations and businesses use Windows servers is because it supports custom modifications to adapt to the business and what it needs. Most individual users won’t need such powerful options. Here I’ll explain how you can enable Wind…
You might have come across a situation when you have Exchange 2013 server in two different sites (Production and DR). After adding the Database copy in ECP console it displays Database copy status unknown for the DR exchange server. Issue is strange…
In this Micro Tutorial viewers will learn how to use Windows Server Backup to create full image of their system. Tutorial shows how to install Windows Server Backup Feature on Windows 2012R2 and how to configure scheduled Bare Metal Recovery backup.…
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…

914 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now