It is not an ldap search solution, but depeding on the number of users you could export the users in EXPORT.ldif and then apply an ldif awk solution in [https://stackoverflow.com/questions/74649357/remove-duplicate-attributes-for-a-core-single-value-no-user-modification-attri/75235694#75235694]. Hier is the modified awk script for duplicate Attribute cn
grep '^dn:\|^cn:' REPORT.ldif | awk
'BEGINN {L1="",L2="";TYP="";DN_PREF="dn:";DN=""}
{
if (TYP==$1 && L2==$2) {
printf("\n%s %s\n%s %s\n%s %s\n--------",
DN_PREF,DN,
$1,$2,
L1,L2);
}
if (TYP==$1) {
DN=$2;
}
L1=$1;
L2=$2;
}'