I am trying to get current windows user that logged into the computer, meaning, windows identity from .NET Framwork 4.5 on windows server 2012. When I use System.Security.Principal.WindowsIdentity.GetCurrent().Name on local computer (win 7), no problem. But it is giving me the apppool name when I try the same on windows 2012 server. I have setup integrated authentication for the apppool and set the impersonate=true/false and no luck either way.
When I try to get System.Security.Principal.WindowsIdentity.GetCurrent().Name, I get the value as "NT AUTHORITY\IUSR" instead of actual domainname\username
Thanks,