Hi,

I got a DTD driver that exports users to a file. It's done by a query in
a for each loop. The query has the max result count set to 200. The
query is for all users in a container (5447). What happens is that if I
run the export with trace level 3 the query return all 5447, but if i
reduce the trace level to 0 or 1 it just returns 1400 objects. I can't
figure out this. Any suggestions?

The code goes like this

<rule>
<description>Export employees</description>
<conditions>
<and>
<if-op-property mode="nocase" name="source"
op="equal">jobExportEmployees</if-op-property>
</and>
</conditions>
<actions>
<do-set-local-variable name="lvEnt" scope="policy">
<arg-string>
<token-text
xml:space="preserve">\RFK-META-TRE\RFK-Meta\IKT\DirXML\Drivere\PSWinCom
- Beredskap\PSWCContact</token-text>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="lvCount" scope="policy">
<arg-string>
<token-text xml:space="preserve">0</token-text>
</arg-string>
</do-set-local-variable>
<do-for-each>
<arg-node-set>
<token-query class-name="User" datastore="src"
max-result-count="200">
<arg-dn>
<token-text
xml:space="preserve">RFK-Meta\Personer\Ansatt</token-text>
</arg-dn>
<arg-string>
<token-text xml:space="preserve">mobile</token-text>
</arg-string>
<arg-string>
<token-text xml:space="preserve">l</token-text>
</arg-string>
<arg-string>
<token-text xml:space="preserve">Given Name</token-text>
</arg-string>
<arg-string>
<token-text xml:space="preserve">Surname</token-text>
</arg-string>
<arg-string>
<token-text xml:space="preserve">Internet EMail
Address</token-text>
</arg-string>
<arg-string>
<token-text
xml:space="preserve">brfkDisplayNameLocation</token-text>
</arg-string>
<arg-string>
<token-text xml:space="preserve">DirXML-EntitlementRef
</token-text>
</arg-string>
<arg-string>
<token-text xml:space="preserve">cn</token-text>
</arg-string>
<arg-string>
<token-text xml:space="preserve">ou</token-text>
</arg-string>
</token-query>
</arg-node-set>
<arg-actions>
<do-if>
<arg-conditions>
<and>
<if-xpath
op="true">$current-node/attr[@attr-name='DirXML-EntitlementRef' and
..//component[@name='volume' and .=$lvEnt]/../component[@name='nameSpace'
and .='1']]</if-xpath>
</and>
</arg-conditions>
<arg-actions>
<do-trace-message>
<arg-string>
<token-text xml:space="preserve">this user has the
entitlement</token-text>
</arg-string>
</do-trace-message>
<do-set-local-variable name="lvCN" scope="policy">
<arg-string>
<token-xpath
expression="$current-node/attr[@attr-name='CN']/value/node()"/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="lvOU" scope="policy">
<arg-string>
<token-xpath
expression="$current-node/attr[@attr-name='OU']/value/node()"/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="lvL" scope="policy">
<arg-string>
<token-xpath
expression="$current-node/attr[@attr-name='L']/value/node()"/>
</arg-string>
</do-set-local-variable>
<do-add-dest-object class-name="User">
<arg-dn>
<token-local-variable name="lvCN"/>
</arg-dn>
</do-add-dest-object>
<do-set-xml-attr expression="../add[last()]" name="src-dn">
<arg-string>
<token-local-variable name="lvCN"/>
</arg-string>
</do-set-xml-attr>
<do-add-dest-attr-value class-name="User" name="FIELD1">
<arg-dn>
<token-local-variable name="lvCN"/>
</arg-dn>
<arg-value type="string">
<token-text xml:space="preserve">CONTACT</token-text>
</arg-value>
</do-add-dest-attr-value>
<do-add-dest-attr-value class-name="User" name="FIELD2">
<arg-dn>
<token-local-variable name="lvCN"/>
</arg-dn>
<arg-value type="string">
<token-text xml:space="preserve">O_</token-text>
<token-local-variable name="lvL"/>
</arg-value>
</do-add-dest-attr-value>
<do-add-dest-attr-value class-name="User" name="FIELD3">
<arg-dn>
<token-local-variable name="lvCN"/>
</arg-dn>
<arg-value type="string">
<token-text xml:space="preserve">C_</token-text>
<token-upper-case>
<token-local-variable name="lvCN"/>
</token-upper-case>
</arg-value>
</do-add-dest-attr-value>
<do-add-dest-attr-value class-name="User" name="FIELD4">
<arg-dn>
<token-local-variable name="lvCN"/>
</arg-dn>
<arg-value type="string">
<token-xpath
expression="$current-node/attr[@attr-name='mobile']/value/node()"/>
</arg-value>
</do-add-dest-attr-value>
<do-add-dest-attr-value class-name="User" name="FIELD5">
<arg-dn>
<token-local-variable name="lvCN"/>
</arg-dn>
<arg-value type="string">
<token-xpath expression="$current-node/attr[@attr-name='Given
Name']/value/node()"/>
</arg-value>
</do-add-dest-attr-value>
<do-add-dest-attr-value class-name="User" name="FIELD6">
<arg-dn>
<token-local-variable name="lvCN"/>
</arg-dn>
<arg-value type="string">
<token-xpath
expression="$current-node/attr[@attr-name='Surname']/value/node()"/>
</arg-value>
</do-add-dest-attr-value>
<do-add-dest-attr-value class-name="User" name="FIELD7">
<arg-dn>
<token-local-variable name="lvCN"/>
</arg-dn>
<arg-value type="string">
<token-xpath expression="$current-node/attr[@attr-name='Internet
EMail Address']/value/node()"/>
</arg-value>
</do-add-dest-attr-value>
<do-add-dest-attr-value class-name="User" name="FIELD8">
<arg-dn>
<token-local-variable name="lvCN"/>
</arg-dn>
<arg-value type="string">
<token-xpath
expression="$current-node/attr[@attr-name='brfkDisplayNameLocatio']/value/node()"/>
</arg-value>
</do-add-dest-attr-value>
<do-add-dest-attr-value class-name="User" name="FIELD9">
<arg-dn>
<token-local-variable name="lvCN"/>
</arg-dn>
<arg-value type="string">
<token-text xml:space="preserve"/>
</arg-value>
</do-add-dest-attr-value>
<do-add-dest-attr-value class-name="User" name="FIELD10">
<arg-dn>
<token-local-variable name="lvCN"/>
</arg-dn>
<arg-value type="string">
<token-text xml:space="preserve"/>
</arg-value>
</do-add-dest-attr-value>
<do-if>
<arg-conditions>
<and>
<if-local-variable mode="regex" name="lvL"
op="equal">RFK|THT|RKT</if-local-variable>
</and>
</arg-conditions>
<arg-actions>
<do-add-dest-attr-value class-name="User" name="FIELD11">
<arg-dn>
<token-local-variable name="lvCN"/>
</arg-dn>
<arg-value type="string">
<token-text xml:space="preserve">G_</token-text>
<token-upper-case>
<token-local-variable name="lvL"/>
</token-upper-case>
<token-text xml:space="preserve">|G_</token-text>
<token-upper-case>
<token-replace-all regex="_na" replace-with="">
<token-replace-all regex="\." replace-with="_">
<token-local-variable name="lvOU"/>
</token-replace-all>
</token-replace-all>
</token-upper-case>
</arg-value>
</do-add-dest-attr-value>
</arg-actions>
<arg-actions/>
</do-if>
<do-if>
<arg-conditions>
<and>
<if-local-variable mode="regex" name="lvOU"
op="equal">vgs\..+</if-local-variable>
</and>
</arg-conditions>
<arg-actions>
<do-add-dest-attr-value class-name="User" name="FIELD11">
<arg-dn>
<token-local-variable name="lvCN"/>
</arg-dn>
<arg-value type="string">
<token-text xml:space="preserve">G_</token-text>
<token-upper-case>
<token-local-variable name="lvL"/>
</token-upper-case>
<token-text xml:space="preserve">|G_</token-text>
<token-upper-case>
<token-local-variable name="lvL"/>
<token-text xml:space="preserve">_ANSATT</token-text>
</token-upper-case>
</arg-value>
</do-add-dest-attr-value>
</arg-actions>
<arg-actions/>
</do-if>
</arg-actions>
<arg-actions/>
</do-if>
<do-set-local-variable name="lvCount" scope="policy">
<arg-string>
<token-xpath expression="$lvCount + 1"/>
</arg-string>
</do-set-local-variable>
</arg-actions>
</do-for-each>
<do-trace-message>
<arg-string>
<token-local-variable name="lvCount"/>
<token-text xml:space="preserve"> objects checked.</token-text>
</arg-string>
</do-trace-message>
</actions>
</rule>

--
FrodeS


--
fsjovatsen
------------------------------------------------------------------------
fsjovatsen's Profile: https://forums.netiq.com/member.php?userid=549
View this thread: https://forums.netiq.com/showthread.php?t=47381