1

I have seen documentation and lot of examples on how to add new entry to a existing group in active directory using LDAP3 but none to add already existing user or entry to another existing group. (to be clear entry already exists in other groups, just needed to be added to another group).

I have tried LDAP3 ADD function which is throwing error as entry already exists and only allows new entries as specified in documentation.

Could you please help me on this.

ram
  • 31
  • 4

1 Answers1

0

Was able to get it working using below function

ldap3.extend.microsoft.addMembersToGroups.ad_add_members_to_groups(connection, members_dn, groups_dn, fix=True, raise_error=False)

Documentation link : https://ldap3.readthedocs.io/ldap3.extend.microsoft.addMembersToGroups.html

This post helped me : ldap3 python add user to group. (not sure if my post will be seen as duplicate as the original post doesn't clearly mention what is the problem. )

ram
  • 31
  • 4