473,698 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Capturing the Windows 2003 login user name in ASP.NET

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
4 1732
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.ServerV ariables("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
Thanks for your help, Rutger.
Nov 19 '05 #3

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

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

<authorizatio n>
<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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4857
by: David Lee | last post by:
Need some help bad here. Am using VB.Net Standard 2003 supplied for a class and I need to install Msde and the sample databases to work on homework. Following the documentation I can download sql2kdesksp3.exe and get the server running. I cannot then install the sample databases according to directions. Log file follows: 2:28:26 AM Wednesday, October 01, 2003: 12:28:26 AM Wednesday, October 01, 2003: Modified the sourceview node of...
10
2418
by: dave | last post by:
Hi I have succesfully captured the users login detail, but I now have a new problem I have assigned the login to a Session Variable, however when I come to use the string stored in the variable it excludes the \ which seperates the domain from the user name, it should be :DOMAIN\USERNAME , but I am getting DOMAINUSERNAME which really is a pain. Anybody know why this is happening and how I can overcome it ? Thanks
1
1547
by: talk_positive | last post by:
Hi... I have made a asp page that accepts some data from user and stores it in MS Access database. Now...I want to identify the user who filled the form and store this information in database. About the enviornment....the server has Windows 2000 server installed. Clients have Windows XP. Server also has Exchange 2003 installed and every client has Outlook Express installed. Every user has to login to his account inorder to use a machine....
3
1944
by: Alex Marsh | last post by:
I want to record the user who created a record (and the user who last changed the record), either initials or a short name How can I capture a user-id? Can it be done from the user info in the Windows Registry, or would it involve setting up Security and getting users to log on to Access? Any suggestions appreciated
14
2541
by: Brent Burkart | last post by:
I am trying to capture the Windows Authenticated username, but I want to be able to capture the login name that exists in IIS, not Windows. In order to enter my company's intranet through the internet, they have to login. I want to be able to capture that login versus their Windows login because I need to know who they are from any computer rather than only their computer. Any ideas? Thanks
3
2408
by: serge calderara | last post by:
Dear all, I clearly underdand the advantage of both type of authentification but is it allowed or possible to set the Authentication mode to Windows and then handle a login form for defined users in Credential section like as follow : <authentication mode="Windows" > <forms loginUrl="Login.aspx"> <credentials passwordFormat="Clear"> <user name="Jessee" password="JuneBug"/>
4
3560
by: Paul Ponzelli | last post by:
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
4
5807
by: =?Utf-8?B?QXZhRGV2?= | last post by:
ASP.Net 2. We are migrating to Windows 2008 64 bit Server with IIS 7 from Windows 2003 32 Bit with IIS 6. A few library classes we wrote uses impersonation in code like explained in this article: http://support.microsoft.com/?id=306158#4 This doesn't work in Windows 2008 Server, we receive the following exception:
0
8608
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8897
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8867
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6522
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.