Skip Navigation Links
Home
+
About
+
Products
+
Support
+
Purchase
+
Search
+
AddNewEntry (Method of LDAPClient)
Add a new Entry to the directory, using the specified attributes and values to initialize it.
Syntax
AddNewEntry(strDn As String, Attributes As StringDictionary) As LDAPEntry
Remarks
Creates a directory entry with the specified DN and is initialized with the specified attribute names and values. The newly-created entry object is returned. When this method returns, it will have created an entry in the directory server. Therefore, when creating an entry, it is necessary to specify all of the attributes that are required by the directory server's schema definition, or the entry creation will fail.
Example
Set pLDAP = CreateObject("LDAPClient.3")
Call pLDAP.Connect("ldapserver")

Set pAttributes = CreateObject("LDAPClient.StringDictionary")

Call pAttributes("givenName").Add("Glenn")
Call pAttributes("sn").Add("Livet")
Call pAttributes("o").Add("airius.com")
Call pAttributes("uid").Add("glivet")
Call pAttributes("cn").Add("Glenn Livet")
Call pAttributes("objectClass").Add("InetOrgPerson")
Call pAttributes("email").Add("glivet@airius.com")
Call pAttributes("email").Add("glenn@airius.com")

Call pLDAP.AddNewEntry("uid=glivet, ou=People, o=airius.com", pAttributes)