I am writing a python script that deletes all the users under an OU. ou=people,cn=AdministrativeLdap,cn=Windchill_11.0,o=ptc.
I am trying to delete the entries by performing the following code but it fails with error " cannot be removed because it has subordinate entries", 'referrals': None, 'type': 'delResponse"
Is there a way by which I can remove the entries alone?
Thank you so much!
from ldap3 import Server, Connection, ALL
s = Server('<IP-ADDRESS>', get_info=ALL)
print(s)
c = Connection(s, user='xxxxxx', password='xxxxxxxxxx')
c.bind()
c.delete('ou=people,cn=AdministrativeLdap,cn=Windchill_11.0,o=ptc',force=True)
print(c.result)
c.unbind()