I am using automation and scripting to pull files from a secure SFTP site to our network. I use a PowerShell script to determine some logic that passes certain parameters for what needs to be pulled and to where. When I run this PowerShell script through PowerShell itself, it works just fine. I am trying to implement this script in BMC Control-M (Control-M is an automation software tool for those who are unaware) to automate the process, but when I run it, it fails saying it could not load the base folder (the SFTP site). All I am doing in Control-M is calling the PowerShell script, so I am not sure why it is failing when it works fine it PowerShell itself.
This may be an issue with Control-M itself, but I just wanted to check and see if the root cause can be fixed here.
Here is my BC Script:
Here is the error message I am getting from my log:
Connecting to ServerName
Server key [ssh-rsa xxxx xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx]
Connection failed: Attempted to open a "Unknown Host Key" dialog when running silently
Attempted to open a "Unknown Host Key" dialog when running silently
Load comparison: C:\MyFolder\CopyToHere <->
Fatal Scripting Error: Unable to load base folder
Script completed in 0.56 seconds
This may be an issue with Control-M itself, but I just wanted to check and see if the root cause can be fixed here.
Here is my BC Script:
Code:
log verbose append:"C:\MyFolder\CopyToHere\PullFiles.log" criteria timestamp:2sec;IgnoreDST size filter cutoff:<10days filter "*.txt" load "C:\MyFolder\CopyToHere" "sftp://username:password@servername" option confirm:yes-to-all expand all select rt.diff rt.older rt.newer rt.orphan copy right->left
Connecting to ServerName
Server key [ssh-rsa xxxx xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx]
Connection failed: Attempted to open a "Unknown Host Key" dialog when running silently
Attempted to open a "Unknown Host Key" dialog when running silently
Load comparison: C:\MyFolder\CopyToHere <->
Fatal Scripting Error: Unable to load base folder
Script completed in 0.56 seconds
Comment