Differences

This shows you the differences between the selected revisions of the page.

2009-04-01 2009-04-01
ssis is common automation tools winscp is run from (martin) generalize (martin)
Line 1: Line 1:
-====== My script works fine when executed manually, but fails or hangs when run by Windows Scheduler, SSIS or other automation tool. What am I doing wrong? ====== +====== My script works fine when executed manually, but fails or hangs when run by Windows Scheduler, SSIS or other automation service. What am I doing wrong? ====== 
-You probably depend on your configuration of WinSCP. Note that when using registry as [[config|configuration storage]], the settings are accessible only for your Windows account. When the script is run from Windows Scheduler, it is typically run under different account that cannot access your configuration.+You probably depend on your configuration of WinSCP. Note that when using registry as [[config|configuration storage]], the settings are accessible only for your Windows account. When the script is run from Windows Scheduler, SSIS or other automation service, it is typically run under different (service) account that cannot access your configuration.
Possible consequences are: Possible consequences are:
-  * The script "hangs" because the [[ssh#verifying_the_host_key|host key]] (SFTP or SCP) or [[ftps#certificate|certificate]] (FTPS) is not known by the Scheduler's account and WinSCP asks for its verification. +  * The script "hangs" because the [[ssh#verifying_the_host_key|host key]] (SFTP or SCP) or [[ftps#certificate|certificate]] (FTPS) is not known by the service's account and WinSCP asks for its verification. 
-  * The connection fails, because your script depends on stored session, which is not known by the Scheduler's account. +  * The connection fails, because your script depends on stored session, which is not known by the service's account. 
-  * Environment variables referenced in script are not resolved, because they are not set by the Scheduler's account.+  * Environment variables referenced in script are not resolved, because they are not set by the service's account.
Solutions: Solutions:
-  * Make sure the [[ssh#verifying_the_host_key|host key]] or [[ftps#certificate|certificate]] is verified under the Scheduler's account. With SSH you can [[scripting#hostkey|specify fingerprint of expected hostkey]]. +  * Make sure the [[ssh#verifying_the_host_key|host key]] or [[ftps#certificate|certificate]] is verified under the service's account. With SSH you can also [[scripting#hostkey|specify fingerprint of expected hostkey]] in the script
-  * [[config#transfering_the_configuration|Transfer the stored session]] (or other settings) to the Scheduler's account.+  * [[config#transfering_the_configuration|Transfer the stored session]] (or other settings) to the service's account.
  * or Use [[config|INI file]] instead of registry to store the configuration. The INI file can be accessed by all accounts.   * or Use [[config|INI file]] instead of registry to store the configuration. The INI file can be accessed by all accounts.

Last modified: by martin