Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 10, 2013 10:31 AM by Pengzhen Song - MSFT
Jan 03, 2013 06:30 PM|LINK
I am creating a web site for internal use without login. I would like to be able to get the Windows username from the web users computer. does anyone know how to do this? Thanks in advance.
Jan 03, 2013 06:35 PM|LINK
Check this out. It should help you:
Jan 03, 2013 06:50 PM|LINK
I tried this already., This will give me the username on the web server. I need the computer username of the web user.
Jan 03, 2013 07:00 PM|LINK
Jan 03, 2013 11:42 PM|LINK
You can use Context.User.Identity.Name to get the login name, it would return name like Domain/Username. If you need to get the full name, department, etc, you need to connect to active directory. For this, you need to contact your IT team to get relevant
Jan 04, 2013 12:15 AM|LINK
try this ..
string Auth_User = HttpContext.Current.Request.ServerVariables["Auth_User"];
Auth_User = Auth_User.Substring(Auth_User.IndexOf("\\") + 1, Auth_User.Length - (Auth_User.IndexOf("\\") + 1));
Jan 06, 2013 09:55 AM|LINK
If you are not using windows authentication, you can't get the windows username in client machine. You need to use windows authentication for that.
Then you can get the user name as below
Please 'Mark as Answer' if this post helps you.
Jan 10, 2013 10:31 AM|LINK
I hope you may get your answer in this link:
And please refer to the issue:
Hope it can help you.