By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,818 Members | 1,381 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,818 IT Pros & Developers. It's quick & easy.

Capturing the Windows 2003 login user name in ASP.NET

P: n/a
I'm using the VB.NET language in ASP.NET, with Windows XP on the desktops
and Windows 2003 on the network servers. When users log on, they have to
enter a user name and password in the netowrk operating system. Is there a
function or other means I can use to capture the Windows 2003 login user
name for use in my code?

Thanks in advance,

Paul
Nov 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi Paul,

First, in the IIS snap-in, go to the Directory Security tab.
There, click the first edit button (Auth. and access control). Disable
Anonymous Access and be sure to check the Integrated Windows
Authentication checkbox.

Now you can readout the username with Request.ServerVariables("LOGON_USER")

There will be another way wit the System.Security but I have to find
that out how to exactly.
Cheers,
//Rutger

http://www.RutgerSmit.com

Paul Ponzelli wrote:
I'm using the VB.NET language in ASP.NET, with Windows XP on the desktops
and Windows 2003 on the network servers. When users log on, they have to
enter a user name and password in the netowrk operating system. Is there a
function or other means I can use to capture the Windows 2003 login user
name for use in my code?

Thanks in advance,

Paul

Nov 19 '05 #2

P: n/a
Thanks for your help, Rutger.
Nov 19 '05 #3

P: n/a

Actually, dotnet can also get logon user data using Iprincipal object
(Page.User):
string logonUser = Page.User.Identity.Name;

Of course, you should deny anonymous access. And you can deny anonymous
access in application level in web.config file:

<authorization>
<deny user="?" /> <!— deny anonymous -->
<allow roles="*" /> <!—allow all other -->
</authorization>

HTH

Elton Wang

"Paul Ponzelli" wrote:
I'm using the VB.NET language in ASP.NET, with Windows XP on the desktops
and Windows 2003 on the network servers. When users log on, they have to
enter a user name and password in the netowrk operating system. Is there a
function or other means I can use to capture the Windows 2003 login user
name for use in my code?

Thanks in advance,

Paul

Nov 19 '05 #4

P: n/a
Thanks for this way of getting the logon user name, Elton.

And thanks for the info about denying anonymous access.

Paul
Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.