Hi,
I am trying to get IIS to write out the current username of the logged on user to a text file. Users can access this webpage from any PC on the internal network. I have another script that takes those usernames and performs some actions but that bit is working fine so not important.
My question is when running it locally via Visual Studio the aspx page correctly outputs my username to the file. But when running this on an IIS server all that gets written to the file is the name of the AppPool the site is using. I am not much of an IIS chap, but I assume this is to be expected in the standard setup. But how to do make it output the current username of the person accessing the page rather than the AppPool. For testing I am just using a blank page with a single button on. The button runs some VB. It creates and writes to the file correctly, just not the information I want!
Dim Username AsString
Username = System.Environment.UserName
My.Computer.FileSystem.WriteAllText("C:\temp\pinreset.txt", Username + vbNewLine, True)
EndSub
Any help greatly appriciated.