Discuss LDAP addition of users in PHP from shell in the LDAP Programming forum on Dev Shed. LDAP addition of users in PHP from shell LDAP Programming forum discussing Lightweight Directory Access Protocol information and techniques. LDAP is used to allow applications to access directory information from a server.
The ASP Free website provides in-depth information on the latest developer tools available from Microsoft. Our cadre of writers, highly experienced industry experts, reveals the best ways to use established technologies as well as new and emerging technologies. Our coverage of Microsoft's development and administration technologies is among the most respected in the IT industry today.
ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month! Download and Activate to enter!
Intel® Graphics Performance Analyzers is a powerful tool suite for analyzing and optimizing your games, media, and graphics-intensive applications. Used by some of the best developers on the planet, Intel GPA lets you maximize your app’s performance.
Posts: 4,836
Time spent in forums: 1 Month 1 Day 15 h 32 m 54 sec
Reputation Power: 633
First "CN=New User,OU=OU Users,DC=picochip3,DC=com" needs to be changed
your DN MUST match up to your CN in the array
"CN=Chris Test from php,OU=OU Users,DC=picochip3,DC=com"
unless there are multiple attributes, DO NOT use an multi dimensional array
$adduserAD['cn'][0] should just be $adduserAD['cn'], because I believe if you put the [0] then it trys to add as multiple attributes and MAY cause problems
No such object normally refers to objectclass, so maybe one of them should NOT be there
Posts: 9
Time spent in forums: 3 h 12 m 29 sec
Reputation Power: 0
thanks very much for shedding some light.
Can I ask if you know how define that im adding a person and not a Group. if there any other attributes that can be used instead of "objectclass" in the above code?
Posts: 4,836
Time spent in forums: 1 Month 1 Day 15 h 32 m 54 sec
Reputation Power: 633
objectClass is required, each objectClass requires other attributes, you can search google and it should give you the required attributes for each objectClass
Posts: 9
Time spent in forums: 3 h 12 m 29 sec
Reputation Power: 0
For Windows what would the DN be?
I have tried:
ldap_add($ds, "cn=".$adduserAD['cn'].",CN=Users,DC=domian,DC=com",$adduserAD)
and
ldap_add($ds, "cn=".$adduserAD['cn'].",O=company_name,C=GB",$adduserAD)
All i get is "operations error"
I have a Win 2003 Server with Exchange installed and am trying to add new users using php and then later on to add in new users with population of exchange mailbox.
Again any help would be greatly receieved / appreciated.
Posts: 9
Time spent in forums: 3 h 12 m 29 sec
Reputation Power: 0
Ok finally cracked it. Very odd i installed some ldap sync application from the web: "PaperCut NG". I've not actually used or configuired it just installed so I assume its somehow enabled ldap v3 for windows 2003.
Now i have a problem tho.
I can add a new user, group and modify group but when I try and add a user with exchange attributes its failes with "Constraint violation". Need to add a user and create a mailbox.
Posts: 297
Time spent in forums: 3 h 34 m
Reputation Power: 10
Quote:
Originally Posted by cjones
Ok finally cracked it. Very odd i installed some ldap sync application from the web: "PaperCut NG". I've not actually used or configuired it just installed so I assume its somehow enabled ldap v3 for windows 2003.
Now i have a problem tho.
I can add a new user, group and modify group but when I try and add a user with exchange attributes its failes with "Constraint violation". Need to add a user and create a mailbox.
Posts: 1
Time spent in forums: 23 m 44 sec
Reputation Power: 0
LDAP modify of users in PHP from shell
I'm trying to change the password of a user's Active Directory through LDAP with PHP.
But the following error appears: Warning: ldap_mod_replace() [function.ldap-mod-replace]: Modify: No such object in /home/httpd/htdocs/qa/cont_usuarios/teste.php on line 32
There was a problem!
See the code below:
$int = "@maildom.intra";
$host = "192.168.1.50";
$user = "claudio".$int;
$pswd = "MinhaSenha";
$ad = ldap_connect($host) or die( "Could not connect!" );
ldap_set_option($ad, LDAP_OPT_PROTOCOL_VERSION, 3) or die ("Could not set ldap protocol");
$bd = ldap_bind($ad, $user, $pswd) or die ("Could not bind");
Nome...: Claudio
Login..: claudio
CN.....: Claudio J. B. Ninin
Desc...: INFORMATICA
E-mail..: Meu email
Warning: ldap_mod_replace() [function.ldap-mod-replace]: Modify: No such object in /home/httpd/htdocs/qa/cont_usuarios/teste.php on line 32
There was a problem!
Posts: 9
Time spent in forums: 3 h 12 m 29 sec
Reputation Power: 0
Unfortunatly the only way I got to reset the password was very complicated.
1st ~I created a VBS script that runs on the W2k3 server which taken and adapted from msdn.
Then I built a server / client socket scripts which then ran the VBS script locally. Its was quiet a pain but I read somewhere that the encryption used for the users passwords cannot work or be reset vi LDAP. Im not entirely sure but I managed to get it all working in the end. In fact I may have the scripts somewhere.