From: rfransix on
Hi, thanks for taking a look at this and helping me resolve this set
search, here's the code and the issue:

set manager [catch {search "$base_obj" -bindid tgt_bind_id -sub -fi
Manager1=$rh_ldap(Manager1) –attr DistinguishedName1} result]

What's returned is: manager=Manager1 value, instead of
manager=DistinguishedName1 value, where $Manager1 is an employeeID
number, and DistinguishedName1 is the AD DN value in every ldap
record.

So, while I'm mapping a person's record from an LDAP to AD, I want to
lookup the person's Manager1 value (an employeeID number) and return
that record's DistinguishedName1 value (the DN of the Manager1's
account in AD) to the manager variable; but all that's returned is the
Manager1 employeeID number. Help?
From: rfransix on
On Apr 29, 4:39 pm, rfransix <rfran...(a)comcast.net> wrote:
> Hi, thanks for taking a look at this and helping me resolve this set
> search, here's the code and the issue:
>
> set manager [catch {search "$base_obj" -bindid tgt_bind_id -sub -fi
> Manager1=$rh_ldap(Manager1) –attr DistinguishedName1} result]
>
> What's returned is:  manager=Manager1 value, instead of
> manager=DistinguishedName1 value, where $Manager1 is an employeeID
> number, and DistinguishedName1 is the AD DN value in every ldap
> record.
>
> So, while I'm mapping a person's record from an LDAP to AD, I want to
> lookup the person's Manager1 value (an employeeID number) and return
> that record's DistinguishedName1 value (the DN of the Manager1's
> account in AD) to the manager variable; but all that's returned is the
> Manager1 employeeID number. Help?



Your help is greatly appreciated, this is cool, important stuff. I've
also tried this code and I still get the Manager1 value instead of the
manager's DistinguishedName1 value (their AD DN):

set exD [lStringEscape $rh_ldap(DistinguishedName1)]
set cmd "search $base_obj -bindid tgt_bind_id -sub -fi Manager1=
$rh_ldap(Manager1)"
set manager [catch "$cmd" $exD]

I can definitely say I'm binding to the local ldap.
We need to get the search looking up Manager1’s employeeNumber,
finding its’ DistinguishedName value and setting it to the manager
field.