import jenkins.model.import hudson.security.*import hudson.plugins.active_directory.
def instance = Jenkins.getInstance()String domain = 'my.domain.com'String site = 'site'String server = '192.168.1.1'String bindName = 'firstname.lastname@example.org'String bindPassword = 'password'
adrealm = new ActiveDirectorySecurityRealm(domain, site, bindName, bindPassword, server)
I am doing automated AD integration with the code mentioned above, however getting issues. bindName is not getting updated on the page and authentication do not work. Also I would like to keep the script in init.groovy.d folder so that it could do the charm when service starts.