LDAP users missing but can login

I’m using Nextcloud 16 on Debian Stretch with PHP 7.3 connected to a LDAP Active Directory server.

The problem I’m experiencing is that all users are able to login to the server, but only some of them (about 2/3) are shown in the user list when logged as admin and are shown in the output of the command sudo -u www-data php occ ldap:search --limit=0 ''.

Could you help me to understand where I’m wrong, please?

Thank you very much!

Bye

This seems to be simple - LDAP query for users is different and narrower that one for user login.

If you use gui, select the appropriate tab in LDAP / AD integration and edit your query.