Ajouter une entrée dans OPENLDAP avec ASP.NET
Par Draggi le mercredi, août 6 2008, 13:32 - ASP.NET / C# - Lien permanent
Comment ajouter une entrée dans un objet LDAP dans OPENLDAP avec C#
DirectoryEntry nRoot = new DirectoryEntry("LDAP://SERVER/ou=documents,o=MyOrganisation,ou=clients,dc=draggi,dc=net","cn=dragan,dc=draggi,dc=net", "XXXXXXX", AuthenticationTypes.None);
DirectoryEntries newLdapDocument = nRoot.Children;
DirectoryEntry newLdapDocumentEntry = newLdapDocument.Add("cn=toto", "document");
newLdapDocumentEntry.Properties["cn"].Value = "toto";
newLdapDocumentEntry.Properties["documentAuthor"].Value = "UN UTILISATEUR DEFINI DANS LDAP";
newLdapDocumentEntry.Properties["documentIdentifier"].Value = "XXXXX";
newLdapDocumentEntry.Properties["documentLocation"].Value = "http://www.draggi.net";
newLdapDocumentEntry.Properties["documentPublisher"].Value = "Draggi";
newLdapDocumentEntry.Properties["documentVersion"].Value = "1.0";
newLdapDocumentEntry.CommitChanges();
nRoot.Close();
En cas de soucis n'hésitez pas à me poster un commentaire je serait ravi de vous fournir les explications.
