[Samba] Get last uidNumber

basti
Tue, 03 Nov 2020 16:24:26 -0000

Hello,
is there a way to get the last uidNumber from ldap.

I can do a ldapsearch like:

ldapsearch -h samdom.example.com -D "administrator at
samdom.example.com"
-w "changeit"  -b "DC=samdom,DC=example,DC=com" -x -LLL
"(uidNumber=*)"
uidNumber | grep -Po "(?<=uidNumber: )([0-9]{4})" | sort | tail -n1

But there is no guarantee that the last returned numer is the last
uidNumber in LDAP.

Is there a limit set by samba how many lines are returned by a query?
Is there a attribute where the last number is stored?

Best Regards