whozie
asked on
dsquery ldap php
Very noobish with ldap/dsquery. Simple question:
How can I do a dsquery in php and interpret the results. What i'm ultimately trying to do is simply get all the groups that exist only in this directory (no duplicates, just unique/distinct list).
The dsquery I'd like to use is:
dsquery group OU=Users and Groups,DC=Applications,DC= MHGroups
I'd probably need to format it with the -o option also.
How can I do a dsquery in php and interpret the results. What i'm ultimately trying to do is simply get all the groups that exist only in this directory (no duplicates, just unique/distinct list).
The dsquery I'd like to use is:
dsquery group OU=Users and Groups,DC=Applications,DC=
I'd probably need to format it with the -o option also.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Yes, ldap_search() is the thing to use. You'll need to get the results of it using ldap_get_entries() and so on.
ASKER
do I just put "dsquery group" in the filter?
function all_groups() {
if($this->_bind) {
$sr=ldap_search($this->_co nn,$this-> _base_dn," dsquery group");
$entries = ldap_get_entries($this->_c onn, $sr);
return $entries;
}
}
function all_groups() {
if($this->_bind) {
$sr=ldap_search($this->_co
$entries = ldap_get_entries($this->_c
return $entries;
}
}
ASKER