LDAP Modify / bind with Scriptrunner - Experiences?

Lars Swart
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 24, 2020

Hi,

I'm trying to use scriptrunner to write information into Microsofts Active directory. 

 

I got the connection working and can read information via LDAP.

 

Here is my groovy script for this, which I use in a Behaviour for a LDAP Picker Field:

-------------

import com.onresolve.scriptrunner.ldap.LdapUtil
import org.springframework.ldap.core.LdapTemplate
import org.springframework.ldap.core.AttributesMapper
import javax.naming.directory.SearchControls
import javax.naming.directory.Attributes
import javax.naming.directory.ModificationItem


def cnList = LdapUtil.withTemplate('LDAP') { template ->
template.search("", "(sn=Br*)", SearchControls.SUBTREE_SCOPE, { Attributes attributes ->
attributes.get('cn').get()
} as AttributesMapper<String>)
}

---------------

 

Now I'm trying to achieve modifying and binding via LDAP.

 

I'm not a very sophisticated developer, so I'm searching for examples in groovy.

Has anybody done something similar to this?

 

Have a nice day

Lars

0 answers

Suggest an answer

Log in or Sign up to answer