Good news everyone! I have a trouble... with LDAP.
Our W2k Active Directory is growing over 6000 entries
and I thing it's not good idea to periodicaly
enlarge Page Size on the server to fit in with my result set.
I want to copy entries from AD to DB for subsequent processing.
So I tried to do it with paging the result set but it didn't pass thru.
I always get the error: "Critical extension is unavailable"
Can anyone help me?
my code:
<?php
define ( 'LDAP_HOST', 'some.server.com' ) ;
define ( 'LDAP_USER', 'CN=I,OU=MYIT,DC=skoda,DC=cz' ) ;
define ( 'LDAP_PWD', 'secret' ) ;
print "\r\nConnect: " ;
print $l = ldap_connect(LDAP_HOST);
print ", " ;
print ldap_error($l);
print "\r\nBind: " ;
print ldap_bind($l,LDAP_USER,LDAP_PWD) ;
print ", " ;
print ldap_error($l);
$aPageControl = array(
array(
'oid' => '1.2.840.113556.1.4.319'
,'iscritical' => true
,'value' => '50,""'
)
);
print "\r\nProtocol version set: " ;
print ldap_set_option($l,LDAP_OPT_PROTOCOL_VERSION,3);
print ", " ;
print ldap_error($l);
print "\r\nPage control set: " ;
print ldap_set_option($l,
LDAP_OPT_SERVER_CONTROLS,$aPageControl);
print ", " ;
print ldap_error($l);
print "\r\nSearch: " ;
print $sr = ldap_search($l, 'dc=skoda,dc=cz', 'cn=martin*', array('distinguishedName'), null, null, null, null);
print ", " ;
print ldap_error($l);
?>
it's result:
Connect: Resource id #2, Success
Bind: 1, Success
Protocol version set: 1, Success
Page control set: 1, Success
Search:
Warning: ldap_search(): Search: Critical extension is unavailable in d:\htdocs\adsi_pumpa\test.php on line 38
, Critical extension is unavailable
modest info:
PHP Manual
hardcore:
RFC2696
AD support:
[URL=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netdir/dsml/ldapcontsesssupp.asp]msdn[/URL]
example for perl:
[URL=http://216.239.53.104/search?q=cache:b50McTFZT5IJ:www.informit.com/isapi/product_id~%257B14F905ED-AC14-4F1A-96CB-4BCDD6A9979E%257D/element_id~%257BCBDEAC91-5B1E-4B1D-84EF-452F6E89FD13%257D/st~%257BB4A53C57-EE2E-4A5C-B77B-40730C78B24A%257D/content/articlex.asp+paging+ldap+active+directory+site:http://www.informit.com&hl=cs&ie=UTF-8]informit[/URL]