Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def ldap_modify(user_list, attribute, new_value):
- ldif = [(ldap.MOD_REPLACE, attribute, new_value)]
- for user in user_list:
- dn="cn={}, ou=users, DC=example, DC=co, DC=uk".format(user)
- l.modify_s(dn, ldif)
- user_list = ['Test User', 'Test User2', ...] # i.e. list of users full names
- attribute = 'description'
- new_value = 'test'
- ldap.NO_SUCH_OBJECT: {'info': '00002030: No such Base DN: sAMAccountName=testuser1, ou=users, DC=example, DC=co, DC=uk', 'desc': 'No such object'}
Add Comment
Please, Sign In to add comment