markcasey
New Member.
217 views

Email Address as replacement for Internet Email Address EDir to AD

Hi

Apologies for the previous empty Post

Ok
I have and EDirectory that I have connected to AD.
All works except whe I try and sync most of my users they return LDAP
Constraint error

Tracked it down. These users have multiple entries in the 'Internet
Email Address' field as Groupwise has multiple email domains and AD'
mail will only take one address as a text field.

The only field available is the Email Address, which is a structure
made up of EmailType and EmailAddr

So I need to replace the content of the internet Email Address
attribute with the EmailAddr component of Email Address.

I cant seem to get the XPath string to work

My rule at the moment looks like

<rule>
<description>Get Primary Email Address1</description>
<comment name="author" xml:space="preserve">Mark
Casey</comment>
<comment name="version" xml:space="preserve">1</comment>
<conditions>
<and>
<if-class-name op="equal">User</if-class-name>
<if-op-attr name="Internet EMail Address"
op="available"/>
</and>
</conditions>
<actions>
<do-set-local-variable name="SingleEmailAddress">
<arg-string>
<token-src-attr name="EMail Address"/>
<token-xpath
expression='$Context/att[.]/component[@name="eMailAddr"] '/>
</arg-string>
</do-set-local-variable>
</actions>
</rule>

Any suggestions would be apreciated

Thanks in advance

Mark
Labels (1)
0 Likes
4 Replies
Anonymous_User Absent Member.
Absent Member.

Re: Email Address as replacement for Internet Email Address EDir to AD


Mark Casey;237050 Wrote:
> Hi
>
> Apologies for the previous empty Post
>
> Ok
> I have and EDirectory that I have connected to AD.
> All works except whe I try and sync most of my users they return LDAP
> Constraint error
>
> Tracked it down. These users have multiple entries in the 'Internet
> Email Address' field as Groupwise has multiple email domains and AD'
> mail will only take one address as a text field.
>
> The only field available is the Email Address, which is a structure
> made up of EmailType and EmailAddr
>
> So I need to replace the content of the internet Email Address
> attribute with the EmailAddr component of Email Address.
>
> I cant seem to get the XPath string to work
>
> My rule at the moment looks like
>
> <rule>
> <description>Get Primary Email Address1</description>
> <comment name="author" xml:space="preserve">Mark
> Casey</comment>
> <comment name="version" xml:space="preserve">1</comment>
> <conditions>
> <and>
> <if-class-name op="equal">User</if-class-name>
> <if-op-attr name="Internet EMail Address"
> op="available"/>
> </and>
> </conditions>
> <actions>
> <do-set-local-variable name="SingleEmailAddress">
> <arg-string>
> <token-src-attr name="EMail Address"/>
> <token-xpath
> expression='$Context/att[.]/component[@name="eMailAddr"] '/>
> </arg-string>
> </do-set-local-variable>
> </actions>
> </rule>
>
> Any suggestions would be apreciated
>
> Thanks in advance
>
> Mark


HI

Can your post the contents of your Variable "Context"?

/Michael


--
mJg2XW
------------------------------------------------------------------------
mJg2XW's Profile: https://forums.netiq.com/member.php?userid=442
View this thread: https://forums.netiq.com/showthread.php?t=49246

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Email Address as replacement for Internet Email Address EDir to AD

Mark Casey wrote:

> So I need to replace the content of the internet Email Address
> attribute with the EmailAddr component of Email Address.

...
> Any suggestions would be apreciated


If I understand you correctly, the following policy should suffice.

<rule>
<description>Get Primary Email Address1</description>
<comment name="author" xml:space="preserve">Mark
Casey</comment>
<comment name="version" xml:space="preserve">1</comment>
<conditions>
<and>
<if-class-name op="equal">User</if-class-name>
<if-op-attr name="Internet EMail Address" op="available"/>
</and>
</conditions>
<actions>
<do-set-local-variable name="varContext" scope="policy">
<arg-node-set>
<token-src-attr name="'EMail Address"/>
</arg-node-set>
</do-set-local-variable>
<do-strip-op-attr name="Internet EMail Address"/>
<do-set-dest-attr-value name="Internet EMail Address">
<arg-value type="string">
<token-xpath expression='$varContext/component[@name="eMailAddr"]
'/>
</arg-value>
</do-set-dest-attr-value>
</actions>
</rule>


--
If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below...
0 Likes
markcasey
New Member.

Re: Email Address as replacement for Internet Email Address EDir to AD

Thanks for that, its what I am looking for but its not identifying the
variable ?

Trace below, shows the variable being returned but not being extracted

[11/19/13 14:38:54.476]:Tutt Bryant AD ST: Action:
do-set-local-variable("PrimaryEmail",scope="policy",arg-node-set(token-sr
c-attr("Email Address"))).
[11/19/13 14:38:54.477]:Tutt Bryant AD ST:
arg-node-set(token-src-attr("Email Address"))
[11/19/13 14:38:54.481]:Tutt Bryant AD ST: token-src-attr("Email
Address")
[11/19/13 14:38:54.482]:Tutt Bryant AD ST: Query from
policy
[11/19/13 14:38:54.483]:Tutt Bryant AD ST:
<nds dtdversion="4.0" ndsversion="8.x">
<source>
<product edition="Evaluation" version="4.0.2.0">DirXML</product>
<contact>Novell, Inc.</contact>
</source>
<input>
<query class-name="User"
dest-dn="\TUTTSAU\TBG\NSW\GRANVILLE\USERS\pegasus"
dest-entry-id="33008" scope="entry">
<read-attr attr-name="Email Address"/>
</query>
</input>
</nds>
[11/19/13 14:38:54.484]:Tutt Bryant AD ST: Pumping XDS to
eDirectory.
[11/19/13 14:38:54.485]:Tutt Bryant AD ST: Performing
operation query for \TUTTSAU\TBG\NSW\GRANVILLE\USERS\pegasus.
[11/19/13 14:38:54.490]:Tutt Bryant AD ST: --JCLNT--
\TUTTSAU\TBG\IDM\TBGIDM\Tutt Bryant AD : Duplicating : context =
1083179083, tempContext = 1083179103
[11/19/13 14:38:54.491]:Tutt Bryant AD ST: --JCLNT--
\TUTTSAU\TBG\IDM\TBGIDM\Tutt Bryant AD : Calling free on tempCont
ext = 1083179103
[11/19/13 14:38:54.495]:Tutt Bryant AD ST: Query from
policy result
[11/19/13 14:38:54.497]:Tutt Bryant AD ST:
<nds dtdversion="4.0" ndsversion="8.x">
<source>
<product edition="Evaluation" version="4.0.2.0">DirXML</product>
<contact>Novell, Inc.</contact>
</source>
<output>
<instance class-name="User"
qualified-src-dn="O=TBG\OU=NSW\OU=GRANVILLE\OU=USERS\CN=pegasus"
src-dn="\TUTTSAU\TBG\NSW\GRANVIL
LE\USERS\pegasus" src-entry-id="33008">
<association
state="associated">b17f4223f7a04b40abe87397ce448a59</association>
<attr attr-name="EMail Address">
<value timestamp="1384831059#36" type="structured">
<component name="eMailType">7</component>
<component
name="eMailAddr">Pegasus.Technology@tuttbryant.com.au</component>
</value>
</attr>
</instance>
<status level="success"></status>
</output>
</nds>
[11/19/13 14:38:54.500]:Tutt Bryant AD ST: Token Value:
{<value> @timestamp = "1384831059#36" @type = "structured"}.
[11/19/13 14:38:54.500]:Tutt Bryant AD ST: Arg Value:
{<value> @timestamp = "1384831059#36" @type = "structured"}.
[11/19/13 14:38:54.501]:Tutt Bryant AD ST: Action:
do-strip-op-attr("Internet EMail Address").
[11/19/13 14:38:54.505]:Tutt Bryant AD ST: Action:
do-set-dest-attr-value("Internet EMail
Address",token-xpath("$varContext/
component[@name="eMailAddr"]")).
[11/19/13 14:38:54.506]:Tutt Bryant AD ST:
arg-string(token-xpath("$varContext/component[@name="eMailAddr"]"))
[11/19/13 14:38:54.506]:Tutt Bryant AD ST:
token-xpath("$varContext/component[@name="eMailAddr"]")
[11/19/13 14:38:54.507]:Tutt Bryant AD ST: Token Value: "".
[11/19/13 14:38:54.507]:Tutt Bryant AD ST: Arg Value: "".
[11/19/13 14:38:54.507]:Tutt Bryant AD ST:Policy returned:
[11/19/13 14:38:54.508]:Tutt Bryant AD ST:




On Mon, 18 Nov 2013 10:15:10 GMT, "Alex McHugh" <alex@olethros.com>
wrote:

>Mark Casey wrote:
>
>> So I need to replace the content of the internet Email Address
>> attribute with the EmailAddr component of Email Address.

>..
>> Any suggestions would be apreciated

>
>If I understand you correctly, the following policy should suffice.
>
><rule>
> <description>Get Primary Email Address1</description>
> <comment name="author" xml:space="preserve">Mark
>Casey</comment>
> <comment name="version" xml:space="preserve">1</comment>
> <conditions>
> <and>
> <if-class-name op="equal">User</if-class-name>
> <if-op-attr name="Internet EMail Address" op="available"/>
> </and>
> </conditions>
> <actions>
> <do-set-local-variable name="varContext" scope="policy">
> <arg-node-set>
> <token-src-attr name="'EMail Address"/>
> </arg-node-set>
> </do-set-local-variable>
> <do-strip-op-attr name="Internet EMail Address"/>
> <do-set-dest-attr-value name="Internet EMail Address">
> <arg-value type="string">
> <token-xpath expression='$varContext/component[@name="eMailAddr"]
>'/>
> </arg-value>
> </do-set-dest-attr-value>
> </actions>
></rule>

0 Likes
markcasey
New Member.

Re: Email Address as replacement for Internet Email Address EDir to AD

Solved it, changed the Xpath to refer to the local Variable name

Thanks

Mark

<rule>
<description>Get Primary Email Address1</description>
<comment name="author" xml:space="preserve">Mark
Casey</comment>
<comment name="version"
xml:space="preserve">1</comment>
<conditions>
<and>
<if-class-name
op="equal">User</if-class-name>
<if-op-attr name="Internet EMail
Address" op="changing"/>
</and>
</conditions>
<actions>
<do-set-local-variable name="PrimaryEmail"
scope="policy">
<arg-node-set>
<token-src-attr name="Email
Address"/>
</arg-node-set>
</do-set-local-variable>
<do-strip-op-attr name="Internet EMail
Address"/>
<do-set-dest-attr-value name="Internet EMail
Address">
<arg-value type="string">
<token-xpath
expression='$PrimaryEmail/component[@name="eMailAddr"]'/>
</arg-value>
</do-set-dest-attr-value>
</actions>
</rule>

On Tue, 19 Nov 2013 03:41:48 GMT, Mark Casey
<markcasey@no-mx.forums.novell.com> wrote:

>Thanks for that, its what I am looking for but its not identifying the
>variable ?
>
>Trace below, shows the variable being returned but not being extracted
>
>[11/19/13 14:38:54.476]:Tutt Bryant AD ST: Action:
>do-set-local-variable("PrimaryEmail",scope="policy",arg-node-set(token-sr
>c-attr("Email Address"))).
>[11/19/13 14:38:54.477]:Tutt Bryant AD ST:
>arg-node-set(token-src-attr("Email Address"))
>[11/19/13 14:38:54.481]:Tutt Bryant AD ST: token-src-attr("Email
>Address")
>[11/19/13 14:38:54.482]:Tutt Bryant AD ST: Query from
>policy
>[11/19/13 14:38:54.483]:Tutt Bryant AD ST:
><nds dtdversion="4.0" ndsversion="8.x">
> <source>
> <product edition="Evaluation" version="4.0.2.0">DirXML</product>
> <contact>Novell, Inc.</contact>
> </source>
> <input>
> <query class-name="User"
>dest-dn="\TUTTSAU\TBG\NSW\GRANVILLE\USERS\pegasus"
>dest-entry-id="33008" scope="entry">
> <read-attr attr-name="Email Address"/>
> </query>
> </input>
></nds>
>[11/19/13 14:38:54.484]:Tutt Bryant AD ST: Pumping XDS to
>eDirectory.
>[11/19/13 14:38:54.485]:Tutt Bryant AD ST: Performing
>operation query for \TUTTSAU\TBG\NSW\GRANVILLE\USERS\pegasus.
>[11/19/13 14:38:54.490]:Tutt Bryant AD ST: --JCLNT--
>\TUTTSAU\TBG\IDM\TBGIDM\Tutt Bryant AD : Duplicating : context =
>1083179083, tempContext = 1083179103
>[11/19/13 14:38:54.491]:Tutt Bryant AD ST: --JCLNT--
>\TUTTSAU\TBG\IDM\TBGIDM\Tutt Bryant AD : Calling free on tempCont
>ext = 1083179103
>[11/19/13 14:38:54.495]:Tutt Bryant AD ST: Query from
>policy result
>[11/19/13 14:38:54.497]:Tutt Bryant AD ST:
><nds dtdversion="4.0" ndsversion="8.x">
> <source>
> <product edition="Evaluation" version="4.0.2.0">DirXML</product>
> <contact>Novell, Inc.</contact>
> </source>
> <output>
> <instance class-name="User"
>qualified-src-dn="O=TBG\OU=NSW\OU=GRANVILLE\OU=USERS\CN=pegasus"
>src-dn="\TUTTSAU\TBG\NSW\GRANVIL
>LE\USERS\pegasus" src-entry-id="33008">
> <association
>state="associated">b17f4223f7a04b40abe87397ce448a59</association>
> <attr attr-name="EMail Address">
> <value timestamp="1384831059#36" type="structured">
> <component name="eMailType">7</component>
> <component
>name="eMailAddr">Pegasus.Technology@tuttbryant.com.au</component>
> </value>
> </attr>
> </instance>
> <status level="success"></status>
> </output>
></nds>
>[11/19/13 14:38:54.500]:Tutt Bryant AD ST: Token Value:
>{<value> @timestamp = "1384831059#36" @type = "structured"}.
>[11/19/13 14:38:54.500]:Tutt Bryant AD ST: Arg Value:
>{<value> @timestamp = "1384831059#36" @type = "structured"}.
>[11/19/13 14:38:54.501]:Tutt Bryant AD ST: Action:
>do-strip-op-attr("Internet EMail Address").
>[11/19/13 14:38:54.505]:Tutt Bryant AD ST: Action:
>do-set-dest-attr-value("Internet EMail
>Address",token-xpath("$varContext/
>component[@name="eMailAddr"]")).
>[11/19/13 14:38:54.506]:Tutt Bryant AD ST:
>arg-string(token-xpath("$varContext/component[@name="eMailAddr"]"))
>[11/19/13 14:38:54.506]:Tutt Bryant AD ST:
>token-xpath("$varContext/component[@name="eMailAddr"]")
>[11/19/13 14:38:54.507]:Tutt Bryant AD ST: Token Value: "".
>[11/19/13 14:38:54.507]:Tutt Bryant AD ST: Arg Value: "".
>[11/19/13 14:38:54.507]:Tutt Bryant AD ST:Policy returned:
>[11/19/13 14:38:54.508]:Tutt Bryant AD ST:
>
>
>
>
>On Mon, 18 Nov 2013 10:15:10 GMT, "Alex McHugh" <alex@olethros.com>
>wrote:
>
>>Mark Casey wrote:
>>
>>> So I need to replace the content of the internet Email Address
>>> attribute with the EmailAddr component of Email Address.

>>..
>>> Any suggestions would be apreciated

>>
>>If I understand you correctly, the following policy should suffice.
>>
>><rule>
>> <description>Get Primary Email Address1</description>
>> <comment name="author" xml:space="preserve">Mark
>>Casey</comment>
>> <comment name="version" xml:space="preserve">1</comment>
>> <conditions>
>> <and>
>> <if-class-name op="equal">User</if-class-name>
>> <if-op-attr name="Internet EMail Address" op="available"/>
>> </and>
>> </conditions>
>> <actions>
>> <do-set-local-variable name="varContext" scope="policy">
>> <arg-node-set>
>> <token-src-attr name="'EMail Address"/>
>> </arg-node-set>
>> </do-set-local-variable>
>> <do-strip-op-attr name="Internet EMail Address"/>
>> <do-set-dest-attr-value name="Internet EMail Address">
>> <arg-value type="string">
>> <token-xpath expression='$varContext/component[@name="eMailAddr"]
>>'/>
>> </arg-value>
>> </do-set-dest-attr-value>
>> </actions>
>></rule>

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.