hi everyone...
i am trying to add users to a windows active directory server using a php script....
my script is the following:
the following script gives the following error:
please help
thanks in advance
i am trying to add users to a windows active directory server using a php script....
my script is the following:
Code:
<?php
$dn = "OU=students,OU=users,DN=ozz,DN=example,DN=com";
$ad = ldap_connect("172.16.50.7")
or die("Couldn't connect to AD!");
ldap_set_option($ad, LDAP_OPT_PROTOCOL_VERSION, 3);
$bd = ldap_bind($ad,"Administrator@ozz.example.com","password")
or die("Couldn't bind to AD!");
$user["givenname"] = "Jason";
$user["sn"] = "Gilmore";
$user["mail"][] = "jason@wjgilmore.com";
$result = ldap_mod_add($ad, $dn, $user);
if ($result) echo "User added!"; else echo "failed";
ldap_unbind($ad);
?>
Code:
Warning: ldap_mod_add() [function.ldap-mod-add]: Modify: Operations error in /var/www/test.php on line 17
thanks in advance