Php ldap ajout d'un utilisateur groupe
Fermé
minato91Info
-
2 mars 2012 à 10:52
minato91Info Messages postés 3 Date d'inscription vendredi 2 mars 2012 Statut Membre Dernière intervention 2 mars 2012 - 2 mars 2012 à 11:21
minato91Info Messages postés 3 Date d'inscription vendredi 2 mars 2012 Statut Membre Dernière intervention 2 mars 2012 - 2 mars 2012 à 11:21
Bonjour,
je suis en train de travailler sur un Active Directory et ma page PHP me permet de creer un utilisateur. Cela fonctionne très bien mais je souhaiterai savoir comment on ajoute cet utilisateur dans le groupe administrateur de domaine.
merci d'avance pour vos réponses.
je suis en train de travailler sur un Active Directory et ma page PHP me permet de creer un utilisateur. Cela fonctionne très bien mais je souhaiterai savoir comment on ajoute cet utilisateur dans le groupe administrateur de domaine.
merci d'avance pour vos réponses.
A voir également:
- Php ldap ajout d'un utilisateur groupe
- Comment créer un groupe whatsapp - Guide
- Sous groupe whatsapp - Accueil - WhatsApp
- Easy php - Télécharger - Divers Web & Internet
- Comment créer un groupe sur facebook - Guide
- Comment utiliser un chromecast - Guide
2 réponses
SI je pouvais voir ton script PHP je pourrais peut être t'aider ;) Donc partage nous ton script s'il te plait.
minato91Info
Messages postés
3
Date d'inscription
vendredi 2 mars 2012
Statut
Membre
Dernière intervention
2 mars 2012
2 mars 2012 à 11:16
2 mars 2012 à 11:16
$server = "localhost";
$port = "389";
$ds=ldap_connect($server);
echo "<br/>connection au serveur LDAP ...<br/>";
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);
$r=ldap_bind($ds,"".$login."@projetweb.com",$pwd);
//$r=ldap_bind($ds,"administrateur@projetweb.com","toto");
echo "<br/>connection réussi<br/>";
//$dn ="CN=Users,DC=projetweb,DC=com";
$entry["cn"]="".$newfirstN." ".$newlastN."";
$entry["givenname"]=$newfirstN;
$entry["sn"]=$newlastN;
$entry["mail"]=$newmail;
$entry["userprincipalname"]="".$newlogin."@projetweb.com";
//$entry["objectclass"][0]="user";
$entry["objectclass"][0] = "top";
$entry["objectclass"][1] = "person";
$entry["objectclass"][2] = "organizationalPerson";
$entry["objectclass"][3] = "user";
$dn="CN=".$newfirstN." ".$newlastN.",CN=Users,DC=projetweb,DC=com";
echo $dn;
// Ajout des données dans l'annuaire
$r=ldap_add($ds,$dn,$entry);
ldap_close($ds);
$port = "389";
$ds=ldap_connect($server);
echo "<br/>connection au serveur LDAP ...<br/>";
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);
$r=ldap_bind($ds,"".$login."@projetweb.com",$pwd);
//$r=ldap_bind($ds,"administrateur@projetweb.com","toto");
echo "<br/>connection réussi<br/>";
//$dn ="CN=Users,DC=projetweb,DC=com";
$entry["cn"]="".$newfirstN." ".$newlastN."";
$entry["givenname"]=$newfirstN;
$entry["sn"]=$newlastN;
$entry["mail"]=$newmail;
$entry["userprincipalname"]="".$newlogin."@projetweb.com";
//$entry["objectclass"][0]="user";
$entry["objectclass"][0] = "top";
$entry["objectclass"][1] = "person";
$entry["objectclass"][2] = "organizationalPerson";
$entry["objectclass"][3] = "user";
$dn="CN=".$newfirstN." ".$newlastN.",CN=Users,DC=projetweb,DC=com";
echo $dn;
// Ajout des données dans l'annuaire
$r=ldap_add($ds,$dn,$entry);
ldap_close($ds);
minato91Info
Messages postés
3
Date d'inscription
vendredi 2 mars 2012
Statut
Membre
Dernière intervention
2 mars 2012
2 mars 2012 à 11:21
2 mars 2012 à 11:21
oui c'est administrateur de domaine