Skip to content

Instantly share code, notes, and snippets.

@cowlike
Last active October 8, 2015 04:39
Show Gist options
  • Save cowlike/3279114 to your computer and use it in GitHub Desktop.
Save cowlike/3279114 to your computer and use it in GitHub Desktop.
@Grab(group='com.unboundid', module='unboundid-ldapsdk', version='2.3.1')
import com.unboundid.ldap.sdk.*
def mr = new ModifyRequest('cn=jrandom,ou=accounts,dc=somewhere,dc=com',
[new Modification(ModificationType.REPLACE, 'msDS-UserAccountDisabled', 'TRUE'.bytes)])
LDAPConnection.metaClass.modify = {ModifyRequest req -> println req; null}
LDAPConnection c = new LDAPConnection()
c.modify(mr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment