linux - Python LDAP - Move user to different OU -
linux - Python LDAP - Move user to different OU -
background: have been using python-ldap module on linux machine manage user accounts on remote windows server 2008. have been able search for, create, , modify users, exception of changing user's 'ou'.
i have tried using 'modify_s' , 'modrdn_s' since modrdn allows alter first part of dn, haven't had luck modifying 'ou' or moving user new 'ou'.
temporarily creating new user , copying attributes able old user, deleting old user. doesn't allow me retain user creation date , other un-editable information.
i have thoroughly searched net , found few solutions, but: on other operating systems: how move user different ou using python , other programming languages: active directory ldap move user different ou - ruby possible in python-ldap on linux or there work-arounds? give thanks you!
you need utilize rename_s
, specify newsuperior
parameter.
quick sample code:
ldap.rename_s('cn=username,ou=oldcontainer,dc=example,dc=com', 'cn=username', 'ou=newcontainer,dc=example,dc=com')
python linux active-directory ldap python-ldap
Comments
Post a Comment