Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Access to OID via ASP

442176Feb 21 2008 — edited Feb 21 2008
Hi,

I used the following code to connect to OID via ASP.

The thing is, I cannot get all attributes from the users.
mail, givenname are ok but costcentre or empleyeenumber does not work.

I trried the same with Java and PHP and there are no problems getting these values.

Anybody knows why??

<% @ Language="VBScript" %>

<%
Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>

<%

Dim strUser
Dim LDAPStmt
Dim Conn
Dim rs

strUser="scott"

Set Conn = CreateObject("ADODB.Connection")
Conn.Provider = "ADsDSOObject"

Conn.Open "Active Directory Provider","cn=orcladmin","mypwd"
LDAPStmt = "<LDAP://imhost.test.com:389/dc=test,dc=com>;(&(uid=" & strUser & "));givenname,uid,costcentre;subtree"

Set rs = Conn.Execute(LDAPStmt)

Response.write "rs.RecordCount: " & rs.RecordCount & "<br /><br />"

rs.MoveFirst
While Not rs.EOF
For i = 0 To rs.Fields.Count - 1
Response.write "rs.Fields(" & i & ").Name: " & rs.Fields(i).Name & "<br />"
Response.write "rs.Fields(" & i & ").Type: " & rs.Fields(i).Type & "<br />"
Response.write "rs.Fields(" & i & ").Value: " & rs.Fields(i).Value & "<br />"
Next
rs.MoveNext
Wend

Conn.Close
Set rs = Nothing
Set Conn = Nothing

%>

Thank you
scratch
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 20 2008
Added on Feb 21 2008
0 comments
2,409 views