Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Trying to make an app that relies on the windows login name of the user, but not sure how I get that working in IIS7, it's not to use it for authentication/login purposes for my app, there is no such thing in what I'm building.

Normally within my code I'd use System.Security.Principal.WindowsIdentity.GetCurrent().Name, with my current IIS config it's returning NT AUTHORITY\IUSR as the value.

Any ideas on what I need to change to get what I'm expecting?

share|improve this question
Let me make sure I understand: You are going to have Windows-only clients attaching to a web application (via IIS) but they do not need to log in. That is, you expect that Kerberos etc. will be set correctly, no non-bound clients will be hitting the app--and you just want to grab that information from the session. Is that right? – Johnnie Odom Apr 3 '11 at 21:59
Hi Johnnie, that's right, it's an internal application for the workplace, anyone connecting to it, by default, will be logged into the work network, that's the only way the url it'll be hosted on is accessible – Psytronic Apr 4 '11 at 6:56

If it's showing the IUSR, then anonymous authentication is kicking in. If you want it password protected then remove anonymous access for the folder(s) that you want users to authenticate. Then, in a domain it will authenticate with their windows account as long as their account is granted access, or in a non-domain it will ask for credentials.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.