Hi monks!

I need to use a read-only unique identifier field for ldap objects. My research has taken me to "objectGUID". However, if I take a query result set and turn right back around to use the objectGUID values for my filter values, I only get hits on about 90% of the original objects. From my tests so far, it appears to be the same objects missing each time.

my $users=$ldap_session->search( base=>$CONF{ldapuserbase}, filter=>$filter, attrs=> ['distinguishedName','sAMAccountName', +'homeDirectory','displayName','objectSid','objectGUID'] ) or die "err +or searching tree:$@\n"; my @entries = $users->sorted('displayName'); print "done.\nFound ".(scalar @entries)." entries.\n"; my $notfound=0; foreach my $e (@entries){ my $guid=$e->get_value('objectGUID'); my $name=$e->get_value('displayName'); my $thisuser=$ldap_session->search( base=>$CONF{ldapuserbase}, filter=>"(objectGUID=$guid)", attrs=> ['distinguishedName','sAMAccountName', +'homeDirectory','displayName','objectSid','objectGUID'] ) or die "err +or searching tree:$@\n"; my @user=$thisuser->sorted('displayName'); if(@user){ #do nothing }else{ print "can't find $name\n"; ++$notfound; } } print "not found=$notfound\n"; $ldap_session->unbind;
I should be able to grab the value and turn right back around and query for it, right? Does anyone have any insight as to what's going on?

ETA: I converted the "not found" objectGUID values to a readable hex string and displayed the values. All the objects have the value of "4" at the start of the 3rd subset. aka, XXXXXXXX-XXXX-4XXX-XXXX-XXXXXXXXXXXX

Coincidence????


In reply to NET::LDAP and objectGUID by ksublondie

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.