Article

lhaeger's picture
article
Reads:

3435

Score:
0
0
 
Comments:

0

Removing Values from the Network Address Field

(View Disclaimer)

Problem

A Forum reader recently asked:

"The "Network Address" field is usually cleared of the previous value, but it is not reliably removed. I'm thinking about using the WorkOrder driver to schedule a <remove-all-values/> for that particular attribute to happen some number of hours after they log in. I was thinking it'd be better if I could schedule it for some number of minutes or hours after they log out."

And here's the response from Lothar Haeger ...

Solution

Have you tried running a regular query for network addresses that have an attribute value timestamp older than xxx hours? You could use something like this:

<do-set-local-variable name="ExpireBefore" scope="policy">
  <arg-string>
    <token-xpath expression="round(jdate:getTime(jdate:new()) div 1000)-~GracePeriod~"/>
  </arg-string>
</do-set-local-variable>
<do-for-each>
  <arg-node-set>
    <token-xpath expression='query:search($srcQueryProcessor, "~WksSearchScope~","","~WksSearchBase~","Workstation","Network Address","*","Network Address")[attr[@attr-name="Network Address"]/value/@timestamp<$ExpireBefore]'/>
  </arg-node-set>
  <arg-actions>
    <do-clear-src-attr-value name="Network Address">
      <arg-dn>
        <token-xpath expression="$current-node/@src-dn"/>
      </arg-dn>
    </do-clear-src-attr-value>
  </arg-actions>
</do-for-each>


Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).

It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.




User Comments

© 2013 Novell