I must remember that the default setup of IIS does not work well with windows authentication if you expect Request.ServerVariables(“LOGON_USER”) to actually return anything other than an empty string.
IIS is initially configured with anonymous access enabled and this must be disabled if using authentication mode=”Windows” in the web.config file.
Another was to retrieve a users domain and/or username, you can use the principal identity, this is provided by importing System.Threading and System.Security.Principle by using something like:
Using System.Threading
Using System.Security.Principle
WindowsPrinciple principal = (WindowsPrincipal)Thread.CurrentPrincipal
dim userAccount as string = Principal.Identity.Name
