Solved

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

Posted on 2013-11-22
13
2,217 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In my previous 24 VMware Articles (http://www.experts-exchange.com/ARTH_1864316.html?arthOrderBy=3&arthSort=1#arth), most featured Intermediate VMware Topics. My next series of articles concentrated on topics for the VMware Novice;   If you would…
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…
In this Micro Tutorial viewers will learn how to restore single file or folder from Bare Metal backup image of their system. Tutorial shows how to restore files and folders from system backup. Often it is not needed to restore entire system when onl…
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…

757 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

18 Experts available now in Live!

Get 1:1 Help Now