A
andrewm659
I am trying to put asp page on our website that pulls information from
out Active Directory database. When someone goes to a certain page and
puts in a name, I want it to come up with all their info from ADS.
Plus we want it to have a picture displayed. Here is what have so far:
<%
strDomainDN = "dc=precisionpractice, dc=com"
Set objCon = CreateObject("ADODB.Connection")
objCon.Provider = "ADsDSOObject;"
objCon.Open "Active Directory Provider"
Set objRS = objCon.Execute("<LDAP://" & strDomainDN & ">;" & _
"(&(objectCategory=Person)(objectClass=user)(mail=*));" & _
"givenname,sn,SamAccountName;subtree" )
objRS.MoveFirst
Response.write "<td><B>" & objRS.Fields(1).Name & "</B></td>"
response.write "<td><B>" & objRS.Fields(2).Name & "</B></td></tr>"
While Not objRS.EOF
response.write "<tr><td>" & objRS.Fields(0).Value & "</td>"
response.write "<td>" & objRS.Fields(1).Value & "</td>"
response.write "<td>" & objRS.Fields(2).Value & "</td>"
'response.write "<td><A HREF=""mailto:" & objRS.Fields(2).Value &
""">"
'response.write objRS.Fields(2).Value & "</A></td></tr>"
objRS.MoveNext
Wend
Set objRS = Nothing
Set objCon = Nothing
%>
But I am not sure how to tie this to a search field in ASP. I am new
to ASP, so any help would greatly appreciated.
out Active Directory database. When someone goes to a certain page and
puts in a name, I want it to come up with all their info from ADS.
Plus we want it to have a picture displayed. Here is what have so far:
<%
strDomainDN = "dc=precisionpractice, dc=com"
Set objCon = CreateObject("ADODB.Connection")
objCon.Provider = "ADsDSOObject;"
objCon.Open "Active Directory Provider"
Set objRS = objCon.Execute("<LDAP://" & strDomainDN & ">;" & _
"(&(objectCategory=Person)(objectClass=user)(mail=*));" & _
"givenname,sn,SamAccountName;subtree" )
objRS.MoveFirst
Response.write "<td><B>" & objRS.Fields(1).Name & "</B></td>"
response.write "<td><B>" & objRS.Fields(2).Name & "</B></td></tr>"
While Not objRS.EOF
response.write "<tr><td>" & objRS.Fields(0).Value & "</td>"
response.write "<td>" & objRS.Fields(1).Value & "</td>"
response.write "<td>" & objRS.Fields(2).Value & "</td>"
'response.write "<td><A HREF=""mailto:" & objRS.Fields(2).Value &
""">"
'response.write objRS.Fields(2).Value & "</A></td></tr>"
objRS.MoveNext
Wend
Set objRS = Nothing
Set objCon = Nothing
%>
But I am not sure how to tie this to a search field in ASP. I am new
to ASP, so any help would greatly appreciated.