Thursday, March 22, 2012

Calling remote batch file using 'Execute process task'

I have a remote batch file on machine B that I need to execute using 'Execute process task' control from a package on machine A. The batch file uses pgp software and encrypts a file sitting on machine B itself. The reason why my batch file is sitting on machine B, is because the PGP software is on machine B.

If I execute the batch file by itself from machine B, the script runs fine. I refer the same batch file as a UNC path from my package on machine A. But that does not work since the 'Working directory' is still machine A. I can not set machine B's folder as the working dir because it does not accept UNC path. So I say, ok , let me map a path to that UNC location and map it as drive 'Z:\'. Certainly if I do so, I will be running the process on machine A and the batch file will look for the pgp software on machine A, and hence fail.

I have tried third party remote batch execution tools (PSEXEC) but have not had success, not because of SSIS limitations, but simply because the PGP executable when run through the PSEXEC tool, does not identify the location of the public keys on machine B and hence gives an encrytion failure.

How do I get the remote batch file to execute such that it executes with its own env? Is there a better remote execution tool I can try or are there any other features of SSIS I can use to get around this issue? I need the results of the batch file and hence do not want to make it an asyncronous process.

Thanks

Sumeet

PsExec will work for this purpose, and so will rsh and ssh implementation for Win32. Psexec is easier and you can use the "-e" parameter to configure alternate profile loading. Even if the environment from psexec were the minimal default user environment, just execute a remote command/script/executable which sets up the environment necessary prior to the pgp call.|||

Thanks. That helps. PsExec sends the alternate profile username/password as clear text. Can this be avoided in any way? I can not send account information to the PGP server as clear text. I am thinking about web service, but that has its own set of issues in executing a batch process, since the identiy of the executing process can not be changed (in 1.1)...

If someone can direct me to the user group where these questions can be better addressed, please let me know!

Thanks,

Sumeet

No comments:

Post a Comment