From: rfransix on
Hi,

Within a process, a mapping table has incoming systemA to outgoing
systemB attribute:values, I want to lookup the value given by systemA-
attributeA on systemB, and place that value in the mapping table to
systemB-attributeB. The lookup is of systemB-attributeA to systemB-
attributeB. Note the process, map, and lookup all occur on systemB.

An array example would be awesome.

Thank you.
From: rfransix on
Any help is very much welcome (:

Here's some code I'm writing, any suggestion on coding the uid lookup
from a pre-mapping script to an ldap server? Is the option to "exec
{ldapsearch $options}" the only way to go here?

global uid
set ID {missing_code_here}($uid)
trace_out $DEBUG_VARIABLE "UserID before parsing: $ID"
regexp -nocase $ID result dnID
set Manager1 $dnID
trace_out $DEBUG_VARIABLE "UserID after parsing : $Manager1"

Thanks.
From: Aric Bills on
On Apr 13, 9:39 am, rfransix <rfran...(a)comcast.net> wrote:
> Any help is very much welcome (:
>
> Here's some code I'm writing, any suggestion on coding the uid lookup
> from a pre-mapping script to an ldap server? Is the option to "exec
> {ldapsearch $options}" the only way to go here?
>
> global uid
> set ID {missing_code_here}($uid)
> trace_out $DEBUG_VARIABLE "UserID before parsing: $ID"
> regexp -nocase $ID result dnID
> set Manager1 $dnID
> trace_out $DEBUG_VARIABLE "UserID after parsing : $Manager1"
>
> Thanks.

Have you looked at the ldap package in Tcllib? http://tcllib.sourceforge.net/doc/ldap.html

Beyond that, I'm having trouble understanding what it is you want to
accomplish. If it's ldap-specific, I can't offer any help, but if
it's a more general Tcl question, maybe you could rephrase it, with
one or more specific examples of what your data looks like and what
you want to have happen with it.
From: rfransix on
On Apr 13, 3:19 pm, Aric Bills <aric.bi...(a)gmail.com> wrote:
> On Apr 13, 9:39 am, rfransix <rfran...(a)comcast.net> wrote:
>
> > Any help is very much welcome (:
>
> > Here's some code I'm writing, any suggestion on coding the uid lookup
> > from a pre-mapping script to an ldap server? Is the option to "exec
> > {ldapsearch $options}" the only way to go here?
>
> > global uid
> > set ID {missing_code_here}($uid)
> > trace_out $DEBUG_VARIABLE "UserID before parsing: $ID"
> > regexp -nocase $ID result dnID
> > set Manager1 $dnID
> > trace_out $DEBUG_VARIABLE "UserID after parsing : $Manager1"
>
> > Thanks.
>
> Have you looked at the ldap package in Tcllib?  http://tcllib.sourceforge.net/doc/ldap.html
>
> Beyond that, I'm having trouble understanding what it is you want to
> accomplish.  If it's ldap-specific, I can't offer any help, but if
> it's a more general Tcl question, maybe you could rephrase it, with
> one or more specific examples of what your data looks like and what
> you want to have happen with it.

Sure. I'll start with some more Tcl code snips:

set DN [getAccountValues $rh_ldap(Manager1) DistinguishedName
set manager $DN

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


I have an incoming channel that brings in the manager1 value, which I
store in a metadirectory (ldap) attribute called manager1; then I need
to take this value which is an ID (number) and do an ldapsearch
(locally) for the distinguishedName value from that ID's account, and
pass it to the manager attribute in an ldif file, where I run an
ldapmodify against AD updating the account's manager attribute with
the manager1 distinguishedName.

Thank you again for helping.
From: rfransix on
I think I may have hit on the answer. Comments?


set DN [catch {search "$base_obj" -bindid tgt_bind_id -sub -fi
employeeNumber=$rh_file(Manager1)} –attr DistinguishedName result]
set manager $DN

Where I'm searching ldap for the DistinguishedName value, of the
record of the employeeNumber value, found in the temporary file
$rh_file(Manager1); that result, being the DN of the Manager1 value of
the employeeNumber; I set that DN to the manager attribute in LDAP and
pass it along to the next system.

What say you?