Problem

A Forum reader asked this question:

“Does anyone know how I can check to see if a user is associated with another driver in the IDM Tree?”

And here’s a suggestion from Lothar Haegar …

Solution

Here’s one way to do it:

<?xml version="1.0" encoding="UTF-8"?>
<policy xmlns:query="http://www.novell.com/nxsl/java/com.novell.nds.dirxml.driver.XdsQueryProcessor">
  <rule>
    <description>Check If Associated: set up variables</description>
      <conditions>
        <and>
          <if-class-name mode="nocase" op="equal">User</if-class-name>
          <if-xpath op="true">@src-dn</if-xpath>
        </and>
      </conditions>
    <actions>
      <do-set-local-variable name="check-dn">
        <arg-string>
          <token-dest-dn/>
        </arg-string>
      </do-set-local-variable>
      <do-set-local-variable name="check-drv-name">
        <arg-string>
          <token-text xml:space="preserve">admin\Driverset\ZK_GUIDs</token-text>
        </arg-string>
      </do-set-local-variable>
      <do-set-local-variable name="check-drv-state">
        <arg-string>
          <token-xpath expression='query:readObject($srcQueryProcessor, "",$check-dn,"","DirXML-Associations")/attr/value[contains(component[@name=
3D"volume"],$check-drv-name)]/component[@name="nameSpace"]'/>
        </arg-string>
      </do-set-local-variable>
      <do-trace-message disabled="true">
        <arg-string>
          <token-text xml:space="preserve">Valid DirXML association states: 1=processed, 2=pending, 3=manual, 4=migrate, all other values=disabled</token-text>
        </arg-string>
      </do-trace-message>
    </actions>
  </rule>
  <rule>
    <description>Check If Associated: Match!</description>
      <conditions>
        <and>
          <if-local-variable mode="numeric" name="check-drv-state" op="equal">1</if-local-variable>
        </and>
      </conditions>
    <actions>
      <do-trace-message color="brgreen">
        <arg-string>
          <token-text xml:space="preserve">Bingo! Object </token-text>
          <token-local-variable name="check-dn"/>
          <token-text xml:space="preserve"> is associated with state                   
          </token-text>
          <token-local-variable name="check-drv-state"/>
          <token-text xml:space="preserve"> for driver </token-text>
          <token-local-variable name="check-drv-name"/>
        </arg-string>
      </do-trace-message>
    </actions>
  </rule>
  <rule>
    <description>Check If Associated: NO Match!</description>
      <conditions>
        <and>
          <if-local-variable mode="nocase" name="check-drv-state" op="not-equal">1</if-local-variable>
        </and>
      </conditions>
    <actions>
      <do-trace-message color="brred">
        <arg-string>
          <token-text xml:space="preserve">Bongo! Object </token-text>
          <token-local-variable name="check-dn"/>
          <token-text xml:space="preserve"> is NOT associated with state  
          </token-text>
          <token-local-variable name="check-drv-state"/>
          <token-text xml:space="preserve"> for driver </token-text>
          <token-local-variable name="check-drv-name"/>
        </arg-string>
      </do-trace-message>
    </actions>
  </rule>
</policy>

1 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 5 (1 votes, average: 5.00 out of 5)
You need to be a registered member to rate this post.
Loading...Loading...
Categories: Uncategorized

Disclaimer: As with everything else at NetIQ Cool Solutions, this content is definitely not supported by NetIQ, so Customer Support will not be able to help you if it has any adverse effect on your environment.  It just worked for at least one person, and perhaps it will be useful for you too.  Be sure to test in a non-production environment.

Leave a Reply

No Comments
lhaeger
By: lhaeger
Sep 20, 2006
3:56 am
Reads:
1,182
Score:
5