Hi.
I'm using LDAP to connect to Active Directory of my domain. I can connect and even create and delete contacts in a organizational unit (that's one of my goals).
In that OU i have a group, and i need that all of that contacts be members of that group.
How can i do that? I tryed LDAP, but i don't know the tree to reach groups neither groups attributtes.
Can anyone help me?
My code:
$link=ldap_connect(SERVER);
ldap_bind($link,"cn=hugo dias,cn=users,dc=di,dc=mni,dc=pt","secret"."<br>";
//echo ldap_bind($link);
$email="had@mni.pt";
/* *******************Adicionar ************************ */
$info["mail"][]=$email;
$info["group"]="newsletter";
$info["objectclass"]="contact";
ldap_add($link,"CN=$email,OU=newsletter,DC=DI,DC=MNI,DC=PT",$info);
This way i insert a new contact. I need to add this contact into the newsletter group that i have in the newsletter OU.
I'm using LDAP to connect to Active Directory of my domain. I can connect and even create and delete contacts in a organizational unit (that's one of my goals).
In that OU i have a group, and i need that all of that contacts be members of that group.
How can i do that? I tryed LDAP, but i don't know the tree to reach groups neither groups attributtes.
Can anyone help me?
My code:
$link=ldap_connect(SERVER);
ldap_bind($link,"cn=hugo dias,cn=users,dc=di,dc=mni,dc=pt","secret"."<br>";
//echo ldap_bind($link);
$email="had@mni.pt";
/* *******************Adicionar ************************ */
$info["mail"][]=$email;
$info["group"]="newsletter";
$info["objectclass"]="contact";
ldap_add($link,"CN=$email,OU=newsletter,DC=DI,DC=MNI,DC=PT",$info);
This way i insert a new contact. I need to add this contact into the newsletter group that i have in the newsletter OU.