I’ve come across this error a couple of times in the past few weeks when migrating old ASP.NET websites to new web servers so I’m popping it into the blog as an aide-memoire for myself and in case it’s useful for others.
In an ASP.Net page you can easily get the username of the currently logged in user with Request.ServerVariables(“AUTH_USER”). With the following code snippet you can also get their real name (the “Display Name”) from the Active Directory.
I’ve recently had the need to write an ASP page which reads a SQL database and outputs into Microsoft Excel- a user clicks on a link to this ASP page and Excel opens up with a new spreadsheet of the data. This is how I did it