473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 8577
ar
Hi,

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

<input type="text" name="myusernamebox" value="<%=request.servervariables("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(TESTDOMAIN). 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.ServerVariables("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_machinename 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
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...
3
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...
4
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...
14
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...
1
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...
5
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
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...
1
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...
11
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...

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.