|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am creating a query that will list all security groups for a set filter. My code currently pulls the name and description of the group but I'm unable to pull the managedBy attribute.
I actually need to get the display name of the user rather than the full dn of the managedBy attribute. Any help would be appreciated. Deborah Here is my current code. <?php // Include code to connect to ldap server include("ldap_connect.php"); // Base dn for search $base_dn = "dc=oilstates, dc=net"; // Filter for search //$filter = "(|(groupType=-2147483640)(groupType=-2147483646)(groupType=-2147483644))"; //| means or so only one condition must be met // This filter is only for testing purposes The one above is the one that shows all security groups $filter = "(&(groupType=-2147483646)(name=*IT - *))"; // Specify only those parameters we're interested in displaying $attributes = array("name","description", "managedBy", "info"); // $connect comes from ldap_connect.php $search = ldap_search($connect, $base_dn, $filter, $attributes) or exit(">>Unable to search ldap server<<"); $info = ldap_get_entries($connect, $search); echo $info["count"]." entries returned<p>"; for ($i=0; $i<$info["count"]; $i++) { echo $info[$i]["name"] [0]." (".$info[$i]["description"][0].") ".$info[$i]["info"][0]."<br />"; echo " - ".$info[$i]["managedBy"][0]."<br />"; } ldap_unbind($connect); ?> |
![]() |
| Viewing: Dev Shed Forums > Databases > LDAP Programming > LDAP Query for security groups using PHP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|