#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Posts
    2
    Rep Power
    0

    OpenLDAP + win2k AD


    Hi all,

    I have a problem on add a new entry to AD, I can search the entry, can bind to ldaps://, however, i cannot add a new entry, my code is:

    ldap_connect("ldaps://www.example.org.hk/);
    ldap_bind($ldap, "cn=admin,DC=example,DC=org,DC=hk", "password");

    //add group
    $entry["ou"][0]="committee";
    $entry["cn"]="Chan Sui Man";
    $entry["name"][0]="Wong Sui Man";
    $entry["samaccountname"]="Chan Sui Man";
    $entry["grouptype"][0]="8";
    $entry["instancetype"][0]="4";
    $entry["sn"][0]="Sui Man";
    $entry["proxyaddresses"][0]="wong@example.org.hk";
    $entry["objectClass"]="top";

    echo $entry["cn"];
    $res =ldap_add($ldap, "cn=Chan Sui Man,ou=committee,DC=example,DC=org,DC=hk", $entry);

    Please help
  2. #2
  3. Psycho Canadian
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Jan 2001
    Location
    Canada
    Posts
    4,846
    Rep Power
    635
    what is the error? what happens when you run the code?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Posts
    2
    Rep Power
    0
    I don't know, but if I set objectclass = User is seems ok.

IMN logo majestic logo threadwatch logo seochat tools logo