Running client specific scripts against multiple clients from one main client
search cancel

Running client specific scripts against multiple clients from one main client

book

Article ID: 233306

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine

Issue/Introduction

Is there any way to run a client specific command (like remove_object()) against multiple clients from one main client?

Environment

Release : 12.3

Component :

Resolution

There is no out of the box way to run a task against multiple clients at once, for something like running the remove_object() script which must be run in a specific client.  You could use a call api like the OS CallAPIs and from one client, run the callapi to log into each other client and run the REMOVE_OBJECT() script in those.  Let's say for example:

You have client 1, 100, 200
in each client you have a user called CALLAPI/DEPT with the "Logon as callapi" privilege
You have a windows agent and on the windows server in C:\automic\callapi you have the windows callapi.
You could run something in the process tab of a windows job like:

!set client to delete from
:set &client# = '1'
!set callapi username, dept, pwd
:set &callapi_user# = 'automic'
:set &callapi_dept# = 'dept'
:set &callapi_pwd# = '1234pass!'
!delete script file
del C:\automic\remove_object_script.txt
!echo command to script file
echo :SET &RET# = REMOVE_OBJECT("USER_NAME_TO_DELETE") > C:\automic\remove_object_script.txt
!Run callapi
C:\automic\callapi\ucxbxxxc.exe script=C:\automic\remove_object_script.txt logon=&client#,&callapi_user#,&callapi_dept#,&callapi_pwd#
 @set retcode=%errorlevel%
 @if NOT %ERRORLEVEL% == 0 goto :retcode