active directory - Ldap Search on the host server -
i developed small c++ application bind user in server using active directory
return name of group. probleme when run application remote computer, run no probleme. when try run @ host server, -the computer hosting active directory
- binding process pass, searching function return operation error
: sample of code.
if ((rc = ldap_simple_bind_s( ld, logindn, password )) != ldap_success ) { printf("ldap_simple_bind_s: %s\n", ldap_err2string( rc )); ldap_unbind_s( ld ); return 10; } printf("bind , authentication server successful\n"); string a="(&(objectclass=person)(cn="+prenom+" "+nom+"))"; rc = ldap_search_ext_s( ld, /* ldap session handle */ searchbase, /* container search */ ldap_scope_onelevel, /* search scope */ a.c_str(), /*search filter*/ null, /* return attributes */ 0, /* return attributes , values */ null, /* server controls */ null, /* client controls */ &timeout, /* search timeout */ ldap_no_limit, /* no size limit */ &searchresult ); /* returned results */ if ( rc != ldap_success ) { cout<<rc<<endl; printf("ldap_search_ext_s: %s\n", ldap_err2string( rc )); ldap_msgfree( searchresult ); ldap_unbind_s( ld ); return 20 ; }
i found answer must use port 3268
instead of 389
Comments
Post a Comment