
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
How to create a Cross Reference for an object in eDirectory
How to create a Cross Reference for an object in eDirectory


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I did something like this some time ago. We needed to link users to departments and we needed it to point both ways, i.e. if a user points to a department then the department should automatically get a pointer to the user and the other way around.
I tried fiddling around with reciprocal attributes but I couldn't get it to work. Instead I created a policy in a null/loopback driver. It automatically keeps both attributes updated when adding/removing on either object. If they are already populated you need to do some kind of migration to get them synced first.
Deletes were not an issue since dn attributes are removed when the target is deleted.
<rule>
<description>Update attribute2 on the department when attribute1 changes on the user</description>
<conditions>
<and>
<if-class-name mode="nocase" op="equal">User</if-class-name>
<if-op-attr name="attribute1" op="changing"/>
<if-src-dn op="in-subtree">~USERSCONTAINER~</if-src-dn>
</and>
</conditions>
<actions>
<do-set-local-variable name="userDN" scope="policy">
<arg-string>
<token-src-dn/>
</arg-string>
</do-set-local-variable>
<do-for-each>
<arg-node-set>
<token-op-attr name="attribute1"/>
</arg-node-set>
<arg-actions>
<do-add-src-attr-value class-name="Group" name="attribute2">
<arg-dn>
<token-xpath expression="$current-node"/>
</arg-dn>
<arg-value type="dn">
<token-local-variable name="userDN"/>
</arg-value>
</do-add-src-attr-value>
</arg-actions>
</do-for-each>
<do-for-each>
<arg-node-set>
<token-removed-attr name="attribute1"/>
</arg-node-set>
<arg-actions>
<do-remove-src-attr-value class-name="Group" name="attribute2">
<arg-dn>
<token-xpath expression="$current-node"/>
</arg-dn>
<arg-value type="dn">
<token-local-variable name="userDN"/>
</arg-value>
</do-remove-src-attr-value>
</arg-actions>
</do-for-each>
</actions>
</rule>
<rule>
<description>Update attribute1 on the user when attribute2 changes on the department</description>
<conditions>
<and>
<if-class-name mode="nocase" op="equal">Group</if-class-name>
<if-op-attr name="attribute2" op="changing"/>
<if-src-dn op="in-subtree">~unitScope~</if-src-dn>
</and>
</conditions>
<actions>
<do-set-local-variable name="departmentDN" scope="policy">
<arg-string>
<token-src-dn/>
</arg-string>
</do-set-local-variable>
<do-for-each>
<arg-node-set>
<token-op-attr name="attribute2"/>
</arg-node-set>
<arg-actions>
<do-add-src-attr-value class-name="User" name="attribute1">
<arg-dn>
<token-xpath expression="$current-node"/>
</arg-dn>
<arg-value type="dn">
<token-local-variable name="departmentDN"/>
</arg-value>
</do-add-src-attr-value>
</arg-actions>
</do-for-each>
<do-for-each>
<arg-node-set>
<token-removed-attr name="attribute2"/>
</arg-node-set>
<arg-actions>
<do-remove-src-attr-value class-name="User" name="attribute1">
<arg-dn>
<token-xpath expression="$current-node"/>
</arg-dn>
<arg-value type="dn">
<token-local-variable name="departmentDN"/>
</arg-value>
</do-remove-src-attr-value>
</arg-actions>
</do-for-each>
</actions>
</rule>
- « Previous
-
- 1
- 2
- Next »