Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Active Directory and LDAP

Status
Not open for further replies.

AnakinPt

Programmer
Mar 29, 2001
583
PT
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,&quot;cn=hugo dias,cn=users,dc=di,dc=mni,dc=pt&quot;,&quot;secret&quot;).&quot;<br>&quot;;
//echo ldap_bind($link);
$email=&quot;had@mni.pt&quot;;

/* *******************Adicionar ************************ */
$info[&quot;mail&quot;][]=$email;
$info[&quot;group&quot;]=&quot;newsletter&quot;;
$info[&quot;objectclass&quot;]=&quot;contact&quot;;
ldap_add($link,&quot;CN=$email,OU=newsletter,DC=DI,DC=MNI,DC=PT&quot;,$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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top