note 123356 added to function.ldap-add

From: Date: Mon, 19 Nov 2018 06:40:17 +0000
Subject: note 123356 added to function.ldap-add
Groups: php.notes 
Request: Send a blank email to php-notes+get-209724@lists.php.net to get a copy of this message
Create Group in Active Directory <?php $ds = ldap_connect("IP-server/localhost"); $base_dn = "CN=Group name,OU=Organization Unit,DC=Domain-name,DC=com";//distinguishedName of group if ($ds) { // bind with appropriate dn to give update access ldap_bind($ds, "CN=Administrator,OU=Organization Unit,DC=Domain-name,DC=com", "some-password"); //Add members in group $member_array = array(); $member_array[0] = "CN=Administrator,OU=Organization Unit,DC=Domain-name,DC=com"; $member_array[1] = "CN=User,OU=Organization Unit,DC=Domain-name,DC=com"; $entry["cn"] = "GroupTest"; $entry["samaccountname"] = "GroupTest"; $entry["objectClass"] = "Group"; $entry["description"] = "Group Test!!"; $entry["member"] = $member_array; $entry["groupType"] = "2";//GroupType="2" is Distribution / GroupType="1" is Security ldap_add($ds,$base_dn,$entry); ldap_close($ds); } else { echo "Unable to connect to LDAP server"; } ?> ---- Server IP: 208.43.231.9 Probable Submitter: 202.22.14.132 ---- Manual Page -- http://php.net/manual/en/function.ldap-add.php Edit -- https://master.php.net/note/edit/123356 Del: integrated -- https://master.php.net/note/delete/123356/integrated Del: useless -- https://master.php.net/note/delete/123356/useless Del: bad code -- https://master.php.net/note/delete/123356/bad+code Del: spam -- https://master.php.net/note/delete/123356/spam Del: non-english -- https://master.php.net/note/delete/123356/non-english Del: in docs -- https://master.php.net/note/delete/123356/in+docs Del: other reasons-- https://master.php.net/note/delete/123356 Reject -- https://master.php.net/note/reject/123356 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#209724) next »