Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.5
10.0
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
Statistic
FMM
Blog
Adds an entry to a tree.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
LDAP JSON | 8.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |
Parameter | Description | Example |
---|---|---|
LDAPRef | The reference number for the LDAP connection. | $ldap |
dn | The name of the entry to add. | |
JSON | The JSON to parse. Must be a JSON array with entries. Each entry has an element operation with Add, Replace, Delete or Increment. Also a node with name "type" and the type to set. Than you can pass with value a single value or with values a list of values. |
Returns OK or error.
"values": ["Hello", "World"] |
Add a new employee to LDAP:
Set Variable [ $ldap ; Value: MBS("LDAP.Connect"; "ldap.test.de"; 0; 389 ) ]
Set Variable [ $r ; Value: MBS("LDAP.Bind"; $ldap; "cn=admin,dc=ldap,dc=test,dc=de"; "S2A2S@home"; "simple" ) ]
Set Variable [ $r ; Value: MBS("LDAP.AddJSON"; $ldap; Employee::_LDAP.Entry.CN; Employee::_LDAP.JSON.Add) ]
Set Variable [ $r ; Value: MBS("LDAP.Release"; $ldap) ]
Example result:
Input JSON used:
[
{
"operation": "Add",
"name": "objectClass",
"values": [
"posixAccount",
"shadowAccount",
"top",
"inetOrgPerson",
"organizationalPerson",
"person"
]
},
{
"operation": "Add",
"name": "uid",
"value": "bob.miller"
},
{
"operation": "Add",
"name": "uidNumber",
"value": "1"
},
{
"operation": "Add",
"name": "cn",
"value": "Bob Miller"
},
{
"operation": "Add",
"name": "mail",
"value": "bob.miller@test.de"
},
{
"operation": "Add",
"name": "homeDirectory",
"value": "/usr/local/var/"
},
{
"operation": "Add",
"name": "sn",
"value": "Miller"
},
{
"operation": "Add",
"name": "employeeType",
"value": "Employee"
},
{
"operation": "Add",
"name": "givenName",
"value": "Bob"
},
{
"operation": "Add",
"name": "employeeNumber",
"value": "77"
},
{
"operation": "Add",
"name": "userPassword",
"value": "xxxx"
},
{
"operation": "Add",
"name": "gidNumber",
"value": "100"
}
]
Created 11st December 2017, last changed 11st July 2020
Feedback: Report problem or ask question.