Application Delivery Management
Application Modernization & Connectivity
CyberRes
IT Operations Management
<description>Reset a user rename</description>
<comment xml:space="preserve">Block a rename, and reset the rename in the source.</comment>
<conditions>
<and>
<if-class-name mode="nocase" op="equal">User</if-class-name>
<if-operation mode="nocase" op="equal">rename</if-operation>
</and>
</conditions>
<actions>
<do-set-local-variable name="lv-rename-reset" scope="policy">
<arg-string>
<token-parse-dn length="1" start="-1">
<token-xpath expression="@old-src-dn"/>
</token-parse-dn>
</arg-string>
</do-set-local-variable>
<do-rename-src-object>
<arg-string>
<token-local-variable name="lv-rename-reset"/>
</arg-string>
</do-rename-src-object>
<do-veto/>
</actions>
</rule>
<rule>
<description>Process Rename Event</description>
<comment xml:space="preserve">The driver shim cannot tell the difference between a move and a rename in Active Directory so publishes both. This rule will check to see if the Rename event really is a Rename.</comment>
<conditions>
<and>
<if-class-name mode="nocase" op="equal">User</if-class-name>
<if-operation mode="nocase" op="equal">rename</if-operation>
</and>
</conditions>
<actions>
<do-set-local-variable name="lv-current-name" scope="policy">
<arg-string>
<token-parse-dn start="-1">
<token-dest-attr name="DirXML-ADContext"/>
</token-parse-dn>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="lv-new-name" scope="policy">
<arg-string>
<token-src-dn convert="true" start="-1"/>
</arg-string>
</do-set-local-variable>
<do-if>
<arg-conditions>
<and>
<if-local-variable mode="nocase" name="lv-current-name" op="not-equal">$lv-new-name$</if-local-variable>
</and>
</arg-conditions>
<arg-actions>
<do-rename-src-object>
<arg-string>
<token-local-variable name="lv-current-name"/>
</arg-string>
</do-rename-src-object>
</arg-actions>
<arg-actions/>
</do-if>
<do-veto/>
</actions>
</rule>