473,788 Members | 3,068 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get Username of a domain user

How can I get the domain, username and PC network name (Win 2000 Pro & Win
XP Pro PC's) of the current logged on user (logged onto a domain and access
an intranet page, Window 2000 server running IIS) and put this automatically
in a textbox in an webpage. Can this be done with asp & VB?

I basically want to automatically populate a username field with the users
logon so the do not need to type it themselves, leading to type errors.

Thanks,

Jach
Jul 19 '05 #1
1 8809
ar
Hi,

You can get domain\username into a textbox by using:

<input type="text" name="myusernam ebox" value="<%=reque st.servervariab les("LOGON_USER ")%>">

I don't think there is a server variable for the name of the client machine.....so not sure on that one.

I have a similar question that hopefully someone can help me with....

I have site running on a Windows 2000 server on my (NT4) internal domain(TESTDOMA IN). I need to be able to display certain information on the web pages based on who is accessing the site. I'm trying to use Request.ServerV ariables("LOGON _USER") to show me who is logged in, but I'm having trouble with it...

If a user is already logged onto TESTDOMAIN, I don't want them to have to re-enter their login information when they try to access the site.

I have DNS set up for the site as http://mysite.mydomain.com. When I try to access the site through this hostname, the LOGON_USER variable is blank...I guess since IIS sees the user hitting the site as the IUSR_machinenam e anonymous account. If I access the site via http://machinename, it returns the correct domain user account. My problem is that I need to set it up using a dns host name....and if I remove anonymous access from the site, the users will be prompted for a username/password every time they hit the site.

How can I determine the user's TESTDOMAIN account name transparently when they try to access http://mysite.mydomain.com?

Thanks very much in advance for any information!
"jach" wrote:
How can I get the domain, username and PC network name (Win 2000 Pro & Win
XP Pro PC's) of the current logged on user (logged onto a domain and access
an intranet page, Window 2000 server running IIS) and put this automatically
in a textbox in an webpage. Can this be done with asp & VB?

I basically want to automatically populate a username field with the users
logon so the do not need to type it themselves, leading to type errors.

Thanks,

Jach

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
4876
by: Ghazan Haider | last post by:
I am posting this for the lack of a better newsgroup, and for the knowledge of people here, and because its only partially OT. We have a bunch of users with their computers at work. There are reports that the users need, which could be in html, php, asp, jsp, whatever. Now I am trying to eliminate the login window entirely. In an html request, the client (firefox, ie, etc) sends the clients hostname, IP, a bunch of other stuff, but...
3
2765
by: Matt | last post by:
Hiya I have to develop a web application for my company in which I need to have a facility for username and password for the employees to do certain tasks. How can this be implemented in ASP. I am thinking of having usernames and passwards (encrypted) in database and when a person tries to log in, the script will compare those stored in databse to the values entered by user. But after the user has logged in, how can I make sure that the...
4
9871
by: Mike | last post by:
Greetings, I am writing an Intranet application in ASP.NET using VB.NET. I am obtaining the username of the user with: uName = User.Identity.Name, which is in the form of DOMAIN\username. I then use substring to parse out just the username. What I am trying to accomplish is getting the full name of the user by doing a search in Active Directory, but I am failing at every turn. This code:
14
2552
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
1
2178
by: Grey | last post by:
Can I use the domain username and password with VSS authentication?? I want to user the domain username and password to authorize the credential of VSS, but I don't want to do anything the Domain AD. What can I do?? I learnt from VSS FAQ in microsoft website that "Can a network password be used to log onto Microsoft Visual SourceSafe 6.0 automatically? Yes, the passwords are controlled by the SourceSafe Administrator and the utility...
5
2575
by: Sadun Sevingen | last post by:
hi i want to run my scripts wih anonymous access IUSR account but i want to learn incoming users AD username like DOMAIN/SADUN ALSO what are the predefined object of ASP.NET ???
6
4598
by: John Dalberg | last post by:
I want to automate the process of logging into an intranet. I want to pull out the username of the Windows user logged into the machine running the browser and use the username in my app. How can I get the logged in username? Do I have to disable the anonymous access in IIS? I rather not because the site is running under a certain domain user which has access to certain folder and network shares and the site needs thsi access for reading...
1
10133
by: Sudhakara.T.P. | last post by:
Hi, I have an application in VB.NET windows application, wherein the administrator has the option to change the authentication mode ie., whether the application should work as a normal database authentication or the windows based authentication mode. If the administrator sets the application authentication mode to windows based, then the application has to verify the windows logged in username and password and then allow the user to use...
11
13469
by: Kirk | last post by:
The following C# web service works fine until you uncomment the lines setting UserName and Password. Then the process starts as the specified user, but hangs in a suspended state. In fact, any executable will exhibit this problem; it is not specific to whoami.exe. This is with .NET 2.0, of course (1.1 does not support running a process as a different user). This appears to be a bug. Can anyone comment? <%@ WebService Language="C#"...
0
9498
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
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10172
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
10110
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
9964
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...
0
6749
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
4069
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
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
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.