Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using - System.Security.Principal.WindowsIdentity.GetCurrent.Name()

Status
Not open for further replies.

ggeorgiou01

Programmer
Apr 11, 2005
60
GB
Hi,

For tracing and other things I need to know the username of the user who is logged in to the pc on which (s)he is running my ASPX page.

I was using:
System.Security.Principal.WindowsIdentity.GetCurrent.Name()
But that provides me with: SERVERNAME\ASPNET

I was hoping for the windows login name of the user.

I am also using: <authentication mode="Windows" /> within the web.config file.

Thanks,
 
As far as I know this is not possible because the server cannot read the principal of the client machine, only the server itself. Hence why you get SERVERNAME\ASPNET which is the account the aspx is running under.

Someone correct me if i'm wrong.

Smeat
 
Request.ServerVariables("AUTH_USER").ToString()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top