LDAP.Add
--------

Adds an entry to a tree.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [LDAP](component_LDAP.md) | [6.0](newinversion60.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |

### Deprecated

This function was [deprecated](deprecated.md). Use [LDAP.AddJSON](LDAPAddJSON.md) instead.

MBS( "LDAP.Add"; LDAPRef; DN; Type { ; Value } ) 

**MBS**( **"LDAP.Add";** /\* Adds an entry to a tree. \*/  
**$LDAPRef**; /\* The reference number for the LDAP connection.e.g. $ldap \*/   
**$DN**; /\* The name of the entry to add. \*/   
**$Type**; /\* The name of the attribute to add. \*/   
**$Value**) /\* Optional; The value for the attribute. \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| LDAPRef | The reference number for the LDAP connection. | $ldap |  |
| DN | The name of the entry to add. |  |  |
| Type | The name of the attribute to add. |  |  |
| Value | The value for the attribute. |  | Optional |

### Result

Returns OK or error.

### Description

Adds an entry to a tree.  
The parent of the entry being added must already exist or the parent must be empty (equal to the root distinguished name) for an add operation to succeed.  
  
With 6.4 plugin you can pass several more value parameters to form a list of values.  
Deprecated. Please use [LDAP.AddJSON](LDAPAddJSON.md) instead.  
### Examples

Add a value:

 MBS ( "LDAP.Add"; $ldap ; "test"; "cn"; "Hello" )  
Add a value with 3 values:

 MBS ( "LDAP.Add"; $ldap ; "test"; "cn"; "Hello"; "World"; "test" )  
### See also

- [LDAP.AddJSON](LDAPAddJSON.md)
- [LDAP.AddList](LDAPAddList.md)
- [LDAP.AddRecord](LDAPAddRecord.md)
- [LDAP.ModifyJSON](LDAPModifyJSON.md)
- [LDAP.Search](LDAPSearch.md)

### Release notes

- **Version 13.0**
    - Fixed a memory leak in [LDAP.AddJSON](https://www.mbsplugins.eu/LDAPAddJSON.shtml) and [LDAP.ModifyJSON](https://www.mbsplugins.eu/LDAPModifyJSON.shtml) and added additional checks for the passed in JSON.
- **Version 10.3**
    - Added option to [LDAP.AddJSON](https://www.mbsplugins.eu/LDAPAddJSON.shtml) and [LDAP.ModifyJSON](https://www.mbsplugins.eu/LDAPModifyJSON.shtml) to include boolean keys "hex" and "base64" in JSON with true value to pass values as hex/base64 string, which the plugin decodes and passes to LDAP server.
- **Version 10.1**
    - Deprecated [LDAP.Add](https://www.mbsplugins.eu/LDAPAdd.shtml), [LDAP.AddList](https://www.mbsplugins.eu/LDAPAddList.shtml), [LDAP.AddRecord](https://www.mbsplugins.eu/LDAPAddRecord.shtml) in favor of [LDAP.AddJSON](https://www.mbsplugins.eu/LDAPAddJSON.shtml).
    - Fixed crash in [LDAP.AddJSON](https://www.mbsplugins.eu/LDAPAddJSON.shtml) with invalid data by improving error handling.
- **Version 8.0**
    - Added [JSON](http://www.mbsplugins.eu/component_JSON.shtml) functions for LDAP: [LDAP.AddJSON](http://www.mbsplugins.eu/LDAPAddJSON.shtml), [LDAP.JSON](http://www.mbsplugins.eu/LDAPJSON.shtml) and [LDAP.ModifyJSON](http://www.mbsplugins.eu/LDAPModifyJSON.shtml).
    - Fixed parameter count error for [LDAP.AddJSON](http://www.mbsplugins.eu/LDAPAddJSON.shtml).
- **Version 7.0**
    - Added [LDAP.AddRecord](http://www.mbsplugins.eu/LDAPAddRecord.shtml) and [LDAP.ModifyRecord](http://www.mbsplugins.eu/LDAPModifyRecord.shtml) functions.

### Blog Entries

- [MBS FileMaker Plugin, version 10.1pr6](https://www.mbsplugins.de/archive/2020-03-02/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 6.4pr2](https://www.mbsplugins.de/archive/2016-07-27/MBS_FileMaker_Plugin_version_6/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 15th December 2015 , last changed 12nd June 2020

  
[LCMS.ProfileInfo](LCMSProfileInfo.md) - [LDAP.AddJSON](LDAPAddJSON.md)

[HTML Version](LDAPAdd.shtml)