Display only manager's name from Active Directory

Posted on 2007-10-19
Last Modified: 2008-01-09
I'm trying to display the manager's name in a web phonelist.  Everything "text" in Active Directory is showing correctly.

However, for the manager, the entire object Category is being displayed.

Instead of "Mary Jane", I get
"CN=Mary Jane,OU=Information Technology,OU=Departments,DC=xxxx,DC=xxxx,DC=xx,DC=xx"

Here is my select code:

strRS = "SELECT displayname,manager,sn,givenname,telephoneNumber,objectCategory,department  FROM 'LDAP://XXXX' WHERE "
     strRS =  strRS & "objectCategory = 'CN=Person,CN=Schema,CN=Configuration,DC=xxxx,DC=xxxx,DC=xx,DC=xx'"
     strRS =  strRS & " and ( telephoneNumber = '5*' "
     strRS =  strRS & " or telephoneNumber = '3*' ) order by sn"
     RS.Open strRS, Conn


And here is my display code

<tr><td width="34%"><b><font face="Verdana" size="2"><%=rs.Fields("department")%> </font></b> </td><td width="34%"><b><font face="Verdana" size="2"><%=rs.Fields("manager")%> </font></b> </td><td width="37%"><b><font face="Verdana" size="2"><%=rs.Fields("displayname")%> </font></b> </td><td width="29%"  align="center"><b><font face="Verdana" size="2" ><%=rs.Fields("telephoneNumber")%></font></b></td></tr>

Question by:shelbyinfotech
    LVL 10

    Accepted Solution

    Try :


    Author Comment

    I still get the same result:
    CN=Mary Jane,OU=Information Technology,OU=Departments,DC=xxxx,DC=xxxx,DC=xx,DC=xx
    LVL 10

    Expert Comment

    You could do this :
    <%=Split(Split(rs("manager").Value, ",")(0), "=")(1)%>

    Open in new window


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
    This demonstration started out as a follow up to some recently posted questions on the subject of logging in: and…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now