IPWorks Auth 2020 JavaScript Edition

Questions / Feedback?

Add Method

Adds an entry specified by DN to the directory server using the type and value attributes defined in the Attributes properties.

Syntax

async ldap.add(): Promise<void>

Remarks

This method adds the entry specified by DN to the directory. All Entries are required to have an objectClass attribute.

In order to add a new entry, first Bind with credentials that will allow you to perform the new addition. To add attributes instead of entries, use the Modify method instead. When specifying multi-valued attributes, specify the attribute type only in the first occurrence of that attribute type in the Attributes properties. Additional occurrences of the same attribute type should specify an attribute type of empty string.

The result of the operation is returned via the Result event.

Example (Add a New Entry, including the multi-valued objectClass attribute)


LDAPControl.DN = "uid=NewUser,ou=Employees,dc=server"
LDAPControl.AttributeCount = 7
LDAPControl.AttributeType(0) = "objectClass"
LDAPControl.AttributeValue(0) = "top"
LDAPControl.AttributeType(1) = ""
LDAPControl.AttributeValue(1) = "person"
LDAPControl.AttributeType(2) = ""
LDAPControl.AttributeValue(2) = "organizationalPerson"
LDAPControl.AttributeType(3) = ""
LDAPControl.AttributeValue(3) = "inetOrgPerson"
LDAPControl.AttributeType(4) = "sn"
LDAPControl.AttributeValue(4) = "UserName"
LDAPControl.AttributeType(5) = "cn"
LDAPControl.AttributeValue(5) = "New S. UserName"
LDAPControl.AttributeType(6) = "uid"
LDAPControl.AttributeValue(6) = "NewUser"
LDAPControl.Add()

 
 
Copyright (c) 2021 /n software inc. - All rights reserved.
IPWorks Auth 2020 JavaScript Edition - Version 20.0 [Build 7721]