LDAP.Modify
-----------

Changes an existing entry.

| 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.ModifyJSON](LDAPModifyJSON.md) instead.

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

**MBS**( **"LDAP.Modify";** /\* Changes an existing entry. \*/  
**$LDAPRef**; /\* The reference number for the LDAP connection.e.g. $ldap \*/   
**$OperationType**; /\* What to do. Can be Delete, Replace or Add.e.g. "Replace" \*/   
**$DN**; /\* The name of the entry to modify. \*/   
**$Type**; /\* The name of the attribute to modify. \*/   
**$Value**) /\* Optional; The value for the attribute. \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| LDAPRef | The reference number for the LDAP connection. | $ldap |  |
| OperationType | What to do. Can be Delete, Replace or Add. | "Replace" |  |
| DN | The name of the entry to modify. |  |  |
| Type | The name of the attribute to modify. |  |  |
| Value | The value for the attribute. |  | Optional |

### Result

Returns OK or error.

### Description

Changes an existing entry.  
If values are being added to or replaced in the entry, the function creates the attribute, if necessary. If values are being deleted, the function removes the attribute if no values remain.  
  
Deprecated. Please use [LDAP.ModifyJSON](LDAPModifyJSON.md) instead.  
### See also

- [LDAP.AddJSON](LDAPAddJSON.md)
- [LDAP.ModifyJSON](LDAPModifyJSON.md)
- [LDAP.ModifyRecord](LDAPModifyRecord.md)
- [LDAP.Search](LDAPSearch.md)

### Release notes

- **Version 13.4**
    - Added check to [LDAP.ModifyJSON](https://www.mbsplugins.eu/LDAPModifyJSON.shtml) and [LDAP.Modify](https://www.mbsplugins.eu/LDAPModify.shtml) to complain if dn is empty.
- **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.Modify](https://www.mbsplugins.eu/LDAPModify.shtml) and [LDAP.ModifyRecord](https://www.mbsplugins.eu/LDAPModifyRecord.shtml) in favor of [LDAP.ModifyJSON](https://www.mbsplugins.eu/LDAPModifyJSON.shtml).
- **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).
- **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 13.4pr3](https://www.mbsplugins.de/archive/2023-08-16/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.1pr6](https://www.mbsplugins.de/archive/2020-03-02/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

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

  
[LDAP.List](LDAPList.md) - [LDAP.ModifyJSON](LDAPModifyJSON.md)

[HTML Version](LDAPModify.shtml)