I am trying to write a python-3 based program that could refresh the members of an active directory group in a daily basis or so. The problem is, I have:
Security group : cn=groupName, ou=Groups, ou=department, dc=some, dc=company,dc=com
User group: ou=Users, ou=department, dc=some, dc=company, dc=com
The membership of user into the group can expire based on certain criteria. So, I have to
- Remove all the members from the group first on a daily basis
- Check every user in User group based on a criteria and add as member of the group if the criteria is met.
I went through ldap3 tutorial but could not find anything relevant to member add/remove.
Can you please advice me any python library that I can use or a code example would be of great help.