Solved

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

Posted on 2013-11-22
13
2,337 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 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Every now and then, Microsoft does something that totally impresses me. It doesn't happen often, but in this case I must say I am thoroughly impressed with Windows Server Backup. One of the long time issues with Windows Backup has been the ability t…
Recently, I was assigned the task of performing a hardware refresh in the datacenter. The previous Windows 2008 systems were connected to the SAN via fiber channel HBA’s and among other thing, had PowerPath installed in order to provide sufficient f…
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.…
This tutorial will walk an individual through the process of configuring basic necessities in order to use the 2010 version of Data Protection Manager. These include storage, agents, and protection jobs. Launch Data Protection Manager from the deskt…

803 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