note 57300 added to function.ldap-add

From: Date: Thu, 29 Sep 2005 21:56:58 +0000
Subject: note 57300 added to function.ldap-add
Groups: php.notes 
Request: Send a blank email to php-notes+get-96018@lists.php.net to get a copy of this message
I took spam2004 at turniton dot dk example and made it a bit better. Maybe my setup was a bit different but either way here is how I added a group in Microsoft Windows Server 2003. <?php // Connect using ldap_connect // Bind using ldap_bind // Set LDAP_OPT_PROTOCOL_VERSION to 3 $member_array = array(); $member_array[0] = "cn=user1,cn=Users,dc=yourdomain,dc=com"; $member_array[1] = "cn=administrator,cn=Users,dc=yourdomain,dc=com"; $addgroup_ad["cn"] = "testgroup"; $addgroup_ad["samaccountname"] = "testgroup"; $addgroup_ad["objectClass"] = "Group"; $addgroup_ad["description"] = "Yep just a test."; $addgroup_ad["member"] = $member_array; $base_dn = "cn=testgroup,cn=Users,DC=yourdomain,DC=com"; ldap_add($ldap_conn,$base_dn,$addgroup_ad); // This is it. ?> Take care and good luck, Chad R. Smith ---- Manual Page -- http://www.php.net/manual/en/function.ldap-add.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+57300 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57300&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57300&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57300&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57300&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57300&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57300&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57300&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+57300&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#96018) next »