Problem

“We have an eDirectory connection between SAP HR and ActiveDirectory. Adding a user in HR results in a Active Directory account. What we need is to execute a script on a Windows server on completion of the ADS account. Is there a way to let the driver start this script?”

And here’s a solution from Patrick Rainier …

Solution

I am using a text driver that executes a script. It looks like this:

<do-set-local-variable name="runtime-instance">
	<arg-object>
		<token-xpath expression="runtime:getRuntime()"/>
	</arg-object>
	</do-set-local-variable>
	<do-set-local-variable name="cmd-line">
	<arg-string>
		<token-text xml:space="preserve">C:\WINDOWS\system32
\cscript.exe</token-text>
		<token-text xml:space="preserve"> </token-text>
		<token-text 
xml:space="preserve">C:\scripts\Insert_Event.vbs</token-text>
		<token-text xml:space="preserve"> </token-text>
		<token-text xml:space="preserve">TIVOLI</token-text>
		<token-text xml:space="preserve"> </token-text>
		<token-attr name="arzBanknummer"/>
		<token-text xml:space="preserve"> </token-text>
		<token-attr name="arzHostId"/>
		<token-text xml:space="preserve"> </token-text>
		<token-attr name="Surname"/>
		<token-text xml:space="preserve"> </token-text>
		<token-attr name="Given Name"/>
		<token-text xml:space="preserve"> </token-text>
		<token-text xml:space="preserve">MODIFY</token-text>
		<token-text xml:space="preserve"> </token-text>
		<token-text xml:space="preserve">RESR</token-text>
		<token-text xml:space="preserve"> </token-text>
		<token-text xml:space="preserve">"Modifying user 
properties"</token-text>
	</arg-string>
	</do-set-local-variable>
	<do-trace-message>
	<arg-string>
		<token-local-variable name="cmd-line"/>
	</arg-string>
	</do-trace-message>
	<do-set-local-variable name="process">
	<arg-object>
		<token-xpath expression="runtime:exec($runtime-
instance, $cmd-line)"/>
	</arg-object>
	</do-set-local-variable>

Don’t forget to declare the runtime-function at the top of the policy:

<policy xmlns:runtime="http://www.novell.com/nxsl/java/java.lang.Runtime" 
>
0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this post.
Loading...Loading...

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
Aug 30, 2006
12:00 am
Reads:
1,120
Score:
Unrated