code/services/LDAPService.php
public function getNodes($cached = true, $attributes = [])
    {
        $cache = self::get_cache();
        $results = $cache->load('nodes' . md5(implode('', $attributes)));

        if (!$results || !$cached) {
            $results = [];
            $records = $this->gateway->getNodes(null, Zend\Ldap\Ldap::SEARCH_SCOPE_SUB, $attributes);
            foreach ($records as $record) {
                $results[$record['dn']] = $record;
            }

            $cache->save($results);
        }

        return $results;
    }
public function getNodes($cached = true, $attributes = [])
    {
        $cache = self::get_cache();
        $results = $cache->load('nodes' . md5(implode('', $attributes)));

        if (!$results || !$cached) {
            $results = [];
            $records = $this->gateway->getNodes(null, Zend\Ldap\Ldap::SEARCH_SCOPE_SUB, $attributes);
            foreach ($records as $record) {
                $results[$record['dn']] = $record;
            }

            $cache->save($results);
        }

        return $results;
    }
Return all nodes (organizational units, containers, and domains) within the current base DN.

@param boolean $cached Cache the results from AD, so that subsequent calls are faster. Enabled by default.
@param array $attributes List of specific AD attributes to return. Empty array means return everything.
@return array