tags:

views:

294

answers:

1

I'm trying to convert this PHP code to query a Lotus Notes Ldap directory in Microsoft ASP

$ldap_serveur = "ldapserver";    // Nom ou IP du serveur LDAP
$ldap_port = 389;     // Port de communications ldap (389 en standard)
$ldap_base = "O=SI";      // Base de l'annuaire LDAP
$conn_ldap=ldap_connect($ldap_serveur, $ldap_port);
if ($conn_ldap) {
    $ldap_acces = ldap_bind($conn_ldap);     // bind anonyme, typique pour un accès en lecture seule
    // Recherche par user
    $sr=ldap_search($conn_ldap,$ldap_base, "uid=USER"); 
    echo 'Nombre d\'enregistrements retournés : ' . ldap_count_entries($conn_ldap,$sr) . '<br />';
    echo 'Lecture des enregistrements ...<br />';
    $info = ldap_get_entries($conn_ldap, $sr);
    echo 'Données pour ' . $info["count"] . ' entrées:<br />';
    for ($i=0; $i<$info["count"]; $i++) {
         print_r ($info[$i]);
        echo '<br />';
        echo $info[0]["mail"][0];
        echo '<br />';
    }
} else {
    exit("Impossible de se connecter au serveur ldap : ".$ldap_serveur);
}

But i can't handle this conversion, all my web queries to find answers for this access failed.

Thanks for help

A: 

User object to make your query

Set oADSystemInfo = CreateObject("ADSystemInfo")

Did your need all the code convertion ?

There is a good tuto in asp

Cédric Boivin
Well that's a good start, but i found many tutorial on this, and i can't find one that's fit my code. The global conversion should be fine !
Jérôme