0

i am looking for a ldap filter to find users who have an multi value attribute with duplicate values.

For example in this case i will find the users with duplicate {PersNumber}:

MVAttribute {PersNumber}111111 {PersNumber}111112

I tried many filters, but i could not find the right one yet.

2
  • Tell us what you have tried and show logs or results and Read: stackoverflow.com/help/how-to-ask Commented Dec 20, 2022 at 9:43
  • Which directory is your server? (OpenLDAP, Active Directory, etc) Commented Dec 20, 2022 at 20:43

1 Answer 1

0

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;
}'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.