tags:

views:

13

answers:

0

I am trying to search through LDAP user entries on a Windows 2008 Server using PHP - PEAR's NET_LDAP2 package to be specific. I have successfully connected to the server as well as bind a user; however, searching for a user results in LDAP_OPERATIONS_ERROR. The most I can find as a solution on this is that it's hard to nail down a solution.

Is anyone familiar with connecting to LDAP via PHP on a Windows 2008 and would know the tweak that's need to access to the directory?

// LDAP Abstraction Layer with static instance of NET_LDAP2.
$LDAPConnection = new LDAPAbstractionLayer('username', 'password');
// Simple filter
$filter = Net_LDAP2_Filter::create('sn', 'begins',  'S');
$searchbase = 'DC=example,DC=domain';
$options = array('scope' => 'sub', 'attributes' => array('sn'));
$search = $LDAPConnection->connection->search($searchbase, $filter, $options);

Thanks for your help.