Ask a Question related to ASP Database, Design and Development.
-
M R T Jones #1
info from Active Directory on ASP page
Hello group
I am not really sure which group to post to - apologies if I have it wrong.
User logs on to the network on a WinXP client with standard username /
password. A w2K server with AD authenticates.
User opens browser and accesses an ASP page on IIS on a different w2K
server.
If the site on IIS is set to use Windows Authentication and Anonymous access
is disabled I am able to use this code to report back on the page their log
on name:
response.write "Hello " & request.servervariables("LOGON_USER")
No problem with this - but I also want to get information from attributes
held in Active Directory, for example their email address and department
How can I do this using an LDAP provider?
My attempts so far using: (adapted from script by Ricahrd Mueller - thanks
and much respect!)
const ADS_NAME_TYPE_NT4 = 3
const ADS_NAME_TYPE_1779 = 1
const ADS_NAME_INITTYPE_DOMAIN = 1
dim objDomain, ADdomainOB, DomainName, objDN, objUser, objTrans, username
username = request.servervariables("LOGON_USER")
set objDomain = ( "LDAP://RootDSE" )
set ADdomainOB = GetObject( "LDAP://" &
bjDomain.Get( "DefaultNamingContext" ) )
DomainName = replace(ucase( ADdomainOB.name ), "DC=", "" )
set objTrans = createobject( "NameTranslate" )
objTrans.init ADS_NAME_INITTYPE_DOMAIN, DomainName
********************
objTrans.set ADS_NAME_TYPE_NT4, DomainName & "\" & username
set objDn = objTrans.Get( ADS_NAME_TYPE_1779 )
set objUser = getObject("LDAP://" & objDN)
response.write objUser.mail & "<br>"
usually fails on starred line with 'error 80090332 The security context
could not be established due to a failure in the
requested quality of service (e.g. mutual authentication or delegation).
If I allow anonymous access on the IIS site properties then it fails to get
the LOGON_USER
Any ideas would be welcome
Thank you
M R T Jones Guest
-
active directory
Hello, I need to get all the AD information from a user that access a intranet ASP.NET page.Does anyone can tell me how to do it? (the user can't... -
Login page against Active Directory - any examples... please help
Download this pdf file. http://uk.builder.com/whitepapers/0,39026692,60075960p-39001074q,00.htm Hope it helps. -- Message posted via... -
Returning multiple results from Active Directory from a Web Service to an ASP page
Hi, I'm new to Web Services and are trying to find information about how I can return multiple results from a Search in Active Directory and view... -
Active Directory Search fails ("The directory service is unavailab
Hi all, I'm having one of those nerve wrecking errors, when trying to perform a simple search in an Active Directory. The objective of the code... -
Asp.net and Active Directory Log On To
Hello, I use Active Directory to authenticate users in my Asp.Net web applications. The problem I'm having is that the user's account are set to...



Reply With Quote

