473,804 Members | 1,992 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

grabbing current username via ADSI?

My users logon to the Patriot domain, my intranet is on sdsddata01 server.
I have a form that people have to click on a dropdown list to pick their
name from the list when submitting a form. Is there any way to grab their
username via ADSI so I can query it against a database that will get
submitted against a form. I have seen a few arcticles regarding this but I
couldn't make sense of them. They are already authenticating when they
login, so I don't want them to have to do it again once they hit the
intranet. Is this possible using ADSI? Will I have to make some permission
changes in IIS as well?

TIA!
Tom
Jul 22 '05 #1
3 2209
"Tom Petersen" <pe****@sdsd.sd bor.edu> wrote in message
news:OJ******** ******@TK2MSFTN GP14.phx.gbl...
My users logon to the Patriot domain, my intranet is on sdsddata01 server.
I have a form that people have to click on a dropdown list to pick their
name from the list when submitting a form. Is there any way to grab their
username via ADSI so I can query it against a database that will get
submitted against a form. I have seen a few arcticles regarding this but I couldn't make sense of them. They are already authenticating when they
login, so I don't want them to have to do it again once they hit the
intranet. Is this possible using ADSI? Will I have to make some permission changes in IIS as well?


In ASP, Request.ServerV ariables("LOGON _USER") captures the username as long
as you have denied anonymous access.
Jul 22 '05 #2
Use
Function PullUserFullnam e(strUser)
Dim User
Set User = GetObject("WinN T://<your domain>/" & strUser & ",user")
PullUserFullnam e = User.Fullname
End Function

from http://www.15seconds.com/issue/020130.htm

HTH
Mike
"Tom Petersen" wrote:
My users logon to the Patriot domain, my intranet is on sdsddata01 server.
I have a form that people have to click on a dropdown list to pick their
name from the list when submitting a form. Is there any way to grab their
username via ADSI so I can query it against a database that will get
submitted against a form. I have seen a few arcticles regarding this but I
couldn't make sense of them. They are already authenticating when they
login, so I don't want them to have to do it again once they hit the
intranet. Is this possible using ADSI? Will I have to make some permission
changes in IIS as well?

TIA!
Tom

Jul 22 '05 #3
On Tue, 18 Jan 2005 07:54:24 -0600, "Tom Petersen"
<pe****@sdsd.sd bor.edu> wrote:
My users logon to the Patriot domain, my intranet is on sdsddata01 server.
I have a form that people have to click on a dropdown list to pick their
name from the list when submitting a form. Is there any way to grab their
username via ADSI so I can query it against a database that will get
submitted against a form. I have seen a few arcticles regarding this but I
couldn't make sense of them. They are already authenticating when they
login, so I don't want them to have to do it again once they hit the
intranet. Is this possible using ADSI?
Yes, but easier using just ASP and Request.ServerV ariables.
Will I have to make some permission
changes in IIS as well?


You have to turn off Anonymous access, otherwise the user won't
authenticate using Windows credentials for you to retrieve.

Jeff
Jul 22 '05 #4

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

Similar topics

3
1749
by: Ryan Ritten | last post by:
Anyone know how it is possible for windows to get the name of the user logged in? I know if you do : Request.Servervariables ("AUTH_USER") it displays the username of the person logged in, but is there a way to get the "Full name" of that user in the active directory?
5
12113
by: Joeri KUMBRUCK | last post by:
Hello, I'm trying to create an ASP page where users can type in a username and password, and these credential should be checked with active directory. If username and password are correct, the script will continue to run otherwise it will stop. Below you will find my code I've programmed until now, at this moment I've got one big problem: my script stops at the line: Set oRootDSE = GetObject("LDAP://RootDSE") Why is this GetObject...
1
1097
by: mike | last post by:
I can think of 3 places where a user's username is stored on their PC: * in the %username% environment variable and * in the Registry. * in at least one WMI class Is there anyway I can get one of them and post it back to the server when I click on a form's Submit button? I want this so I can run an ADSI query to obtain other user info such as full name and email address - I'm not sure if either of these are
5
37049
by: mvr | last post by:
Hi all How to get the Windows current logged user name using Classic ASP. If no direct way are there any work arounds. Thanks mvr
4
7119
by: Leszek | last post by:
Hello! I have my webpage (ASP) in domain (IIS 6.0). I need to make a popup with fullname of current user. How can I do this? Maybe someone have any examples? Thanks!
5
1336
by: James54321 | last post by:
Hi. I am hoping it is possible to 'grab' the username from when a user enters their username and password to enter a directory ie say I sign in with joe as the username i want the page in that directory to keep a record that joe logged in and did whatever he did on the page (ie approve delete or ban items - i konw the mysql code for this so i just need to know how to get the username ) Thanks, James.
3
26657
by: dorrit.Riemenschneider | last post by:
I need to validate a user with username and password against our OpenLDAP active directory. This is my code: Private bool ValidateUser (string username, string password) { DirectoryEntry userEntry = new DirectoryEntry( ldapPath, username, password, AuthenticationTypes.Anonymous); //Bind to the native AdsObject to force authentication.
8
3137
by: John | last post by:
Hi, gurus, How can I implement the following feature in C#: Set objGroup = GetObject("WinNT://" & strComputer & "/" & strGroup & ", group") For Each objMember In objGroup.Members WScript.Echo vbCrLf & " Name: " & objMember.Name Next
0
4803
by: =?Utf-8?B?QW50b25pbyBPJydOZWFs?= | last post by:
We changed a username in AD. The user now logs on to a computer on our network using the new username without any problems. They can not logon using the old username. However, when they access a IIS 6.0 web site where a programmer compares system.web.httpcontext.current.user.identity.name to a lookup table containing usernames they could not gain access with the new userid. We created a web page to show what...
0
9711
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9593
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
10595
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
10088
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
7633
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
6862
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();...
0
5668
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
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.