Automatically clean LDAP user occ user: delete

Hello,
I want to automate the LDAP cleanup process. With “sudo -u www-data php occ ldap: show-remnants” I can see the orphaned LDAP user objects. And with the command “sudo -u www-data php occ user: delete [user]”, individual deleted users can be permanently deleted. How can I use this command to delete all orphaned objects in one go?
Many Thanks

See here: https://help.nextcloud.com/t/oc-user-nouserexception/19051/5

1 Like

Sorry for my delay. I was out of office the last days.

Thank you for your answear. With the informations inside your link I was able to solve our problem. I had to do some modifications because our nextcloud enviroment runs in a docker container;-))