Link to home
Start Free TrialLog in
Avatar of shelbyinfotech
shelbyinfotech

asked on

Display only manager's name from Active Directory

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>

>>>>
ASKER CERTIFIED SOLUTION
Avatar of effx
effx
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of shelbyinfotech
shelbyinfotech

ASKER

I still get the same result:
CN=Mary Jane,OU=Information Technology,OU=Departments,DC=xxxx,DC=xxxx,DC=xx,DC=xx
You could do this :
<%=Split(Split(rs("manager").Value, ",")(0), "=")(1)%>

Open in new window