Advertisement

12.01.2008 at 10:21AM PST, ID: 23947512
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.4

Query LDAP For Existing User - Classic ASP

Asked by robertmayhue_iii in Active Server Pages (ASP), Lightweight Directory Access Protocol (LDAP), Active Directory

Tags: ,

I am trying to query a server on the network via an ASP page. I need to determine if the user already exists in Active Directory on the server via LDAP. I found the following code and it will retrieve the user info requested. But I need to query for the loginname. If I try to edit the code to retrieve it I get "Permission Denied" error in ASP.

I am not stuck to the code provided. I just want to query for a given loginname (I may be calling this the wrong thing, it is the unique username for the entry) and return true or false. I have done some reading and notice that I may need to set permissions on IIS, but I need direction. I am running asp on Windows 2000. The AD is on a Windows 2003 server in the same network.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
strUser = "domainname\user"
strPassword = "password"
Dim Conn, strRS, RS, strConn 
Set Conn = Server.CreateObject("ADODB.Connection") 
Set RS = Server.CreateObject("ADODB.Recordset") 
 
Conn.Provider = "ADsDSOObject" 
Conn.Properties("User ID") = strUser
Conn.Properties("Password") = strPassword
Conn.Properties("Encrypt Password") = True
strConn = "Active Directory Provider" 
Conn.Open strConn , strUser, strPassword
 
strRS = "SELECT sn,givenName,memberOf FROM 'LDAP://domain' WHERE sn = 'Buchanan' ORDER by name " 
RS.Open strRS, Conn,1,1
While RS.EOF = False 
memgroups = rs("memberOf")
for each memgroup in memgroups
%>             
<%=rs.Fields("sn")%> - <%=rs.Fields("givenname")%>&nbsp;<%=memgroup%><br> 
<% 
next
RS.MoveNext 
Wend 
%>
 
Loading Advertisement...
 
[+][-]12.01.2008 at 10:59AM PST, ID: 23071308

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.02.2008 at 06:08AM PST, ID: 23076891

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.02.2008 at 06:28AM PST, ID: 23077051

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.05.2008 at 01:46AM PST, ID: 23103522

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Active Server Pages (ASP), Lightweight Directory Access Protocol (LDAP), Active Directory
Tags: ASP, Internet Explorer, FireFox
Sign Up Now!
Solution Provided By: mrGreen
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080924-EE-VQP-38 - Hierarchy / EE_QW_2_20070628