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