Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Getting Active Directory info into ASP

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,2228
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> Getting Active Directory info into ASP
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Getting Active Directory info into ASP - 3/3/2005 3:39:53 AM   
  Rikkimaru

 

Posts: 8
Score: 0
Joined: 2/2/2005
From:
Status: offline
I have an interesting challenge.

I'm working with an application that currently allows users to log in, validate themselves via username and password located in a database and then change user-specific details.

I have windows machines on my network. Is there a way to pull windows active directory information using ASP? Specifically, I want ASP to retrieve a client's network user-name.

The idea is to have the user's network name captured by ASP and then the database can searched using the client's user-name.

I know that it's kinda crazy, but what would life be without experimentation?
 
 
Post #: 1
 
 Re: Getting Active Directory info into ASP - 3/7/2005 1:18:16 AM   
  raidip

 

Posts: 2
Score: 0
Joined: 3/4/2005
From:
Status: offline
Hi,
You can use Request.ServerVariables("REMOTE_USER") to capture the Active user ID of the currently logged in user. It will come with the domain name which you'd have to strip off.
Hope it helps!
D

(in reply to Rikkimaru)
 
 
Post #: 2
 
 Re: Getting Active Directory info into ASP - 3/10/2005 2:07:40 AM   
  Rikkimaru

 

Posts: 8
Score: 0
Joined: 2/2/2005
From:
Status: offline
Thanks for the help raidip.

Here's what I came up with...
This isn't the complete code, but it is the section I was having trouble with.

Request.ServerVariables("REMOTE_USER") should work too, but this value seems to be nulled when IIS is set to "Anonymous Authentification" Mode. I guess I just played it safe.

In addition to this, I turned Anonymous Authentification off and turned Windows Authentification on in IIS for the pages that used this code.

It works fine right now except for people who don't have their emails configured properly either in Active Directory or the SQL Database.


      

(in reply to Rikkimaru)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> Getting Active Directory info into ASP Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts