How to get at the current users windows identity

The site is running on my local IIS 6.1. I Would like to add some features to pull information from our AD. My AD code works on many other projects and on my dev server. Here are my attempts at writing out the username:

Response.Write("1. " + this.Request.LogonUserIdentity.Name);
Response.Write("2. " + Request.ServerVariables["Auth_User"]);
Response.Write("3. " + WindowsIdentity.GetCurrent().Name.ToString());

The results I get are:

  1. NT AUTHORITY\IUSR
  2. administrator
  3. NT AUTHORITY\NETWORK SERVICE

How can I get at the actual windows username like ourdomain/username

Thanks

9
задан Phil 8 March 2011 в 09:40
поделиться