Re: Get the current logged in user name

From: Jim in Arizona (
Date: 08/03/05

Date: Tue, 2 Aug 2005 16:12:46 -0700

"Imran Aziz" <> wrote in message
> Hello All,
> I am new to .net. I want to use windows authentication to authenticate
> against the current logged in user on the client machine. I believe by
> using windows authentication method, the IIS will send me details of the
> current logged in user at the client machine if integrated windows
> authentication is enabled at IIS. Can anyone please guide me how I can get
> the name of the current logged in client that is making a request to my
> application ?
> I am trying to look into System.Web.Security class for this but have not
> been able to find a piece of code or guidance of how to do it.
> Imran.

I used this in my ASP pages and still use it in ASP.NET although there's
obviously many other was to achieve the same/similar result.

Dim strWho as String
strWho = Request.ServerVariables("AUTH_USER")
strWho = Request.ServerVariables("LOGON_USER")