Article

Patrick Rainer's picture
article
Reads:

4274

Score:
0
0
 
Comments:

0

Running a Driver Script after AD Account Creation

(View Disclaimer)

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

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