Novell Home

Running a Driver Script after AD Account Creation

Novell Cool Solutions: Tip
By Patrick Rainer

Digg This - Slashdot This

Posted: 30 Aug 2006
 

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" 
>


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell