Velocity Reviews

Velocity Reviews (
-   ASP General (
-   -   In ASP, how to connect to LDAP by not using complete names? (

Fie Fie Niles 09-09-2004 08:25 PM

In ASP, how to connect to LDAP by not using complete names?
In an ASP page, when I use the OpenDSObject to connect to LDAP, it works
when I use the complete user name.
For example:
If I use "John A Smith" or "Paul B Allen" and set strUserName = "cn=John A
Smith,ou=medel,o=uniba", the user is authenticated succesfully.

If I use "JSmith" or "PAllen" and set strUserName =
"cn=JSmith,ou=medel,o=uniba", I got an error '8007052e'.

Is this right ? Is there a way to NOT use the complete name ?
Thank you very much.

This is my ASP page:

strADsPath = "LDAP://LDAP"
if (not strADsPath= "") then
' bind to the ADSI object and authenticate Username and password
set oADsNamespace = GetObject("LDAP:")
Set oADsObject = oADsNamespace.OpenDSObject(strADsPath, strUserName,
strPassword, 0)
if not (Err.number = 0) then
Response.Write "Failed to bind to object " & strADsPath
Response.write err.number & ":" & err.description
Response.Write "Currently viewing object at " & oADsObject.ADsPath
Response.Write "UserName is " & oADsObject.Name
end if
end if

All times are GMT. The time now is 09:03 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.