winscp.com attempting to automate upload from c:\windows\system32\certsrv\certenroll\
hi, we have two server 2012 R2 servers with winscp (gui client) installed (version: 5.7.4 - build 5553) and we have scripted it to attempt to upload files from the server where the winscp is installed, to two web servers.
i have tested the script and it does work from a (different directory) and on another pc (windows 8.1) but for some reason, it wont 'put' files referenced from that directory, any suggestions or steps i am missing? i searched around and wasnt able to find anything like my situation
ps: its used to upload crl's for our pki servers as part of the 2012 PKI infrastructure here.
script launch parameters:
c:\Program Files (x86)\WinSCP>winscp.com /script=c:\scripts\crl_transfer_pki.txt
===
script layout
===
# This script uploades the newly created CRLs To the PKI servers And overwrites existing files On the PKI Hosts
# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect to SFTP server PKI-01 using a password
open sftp://xxxxxxxx:xxxxx@xxxxx.replaceme.com.au/ -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
# Change remote directory *using a temp location*
cd /var/www/html/CertEnroll
# Upload file
put C:\Windows\System32\certsrv\CertEnroll\*.crl
#
# Disconnect
#
#
# Connect to SFTP server PKI-02 using a password
open sftp://xxxxxxxx:xxxxx@xxxxx.replaceme.com.au/ -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
# Change remote directory *using a temp location*
cd /var/www/html/CertEnroll
# Upload file
put C:\Windows\System32\certsrv\CertEnroll\*.crl
#
# Disconnect
close
# Exit WinSCP
exit
===
when run, this is the output:
===
batch abort
reconnecttime 120
confirm off
Searching for host...
Connecting to host...
Authenticating...
Using username "crl".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Session started.
Active session: [1] crl@xxxxx.replaceme.com.au
/var/www/html/CertEnroll
No file matching '*.crl' found. (System Error. Code: 3.
The system cannot find the path specified)
Searching for host...
Connecting to host...
Authenticating...
Using username "crl".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Session started.
Active session: [2] crl@xxxxx.replaceme.com.au
/var/www/html/CertEnroll
No file matching '*.crl' found. (System Error. Code: 3.
The system cannot find the path specified)
Session 'crl@xxxxx.replaceme.com.au' closed.
Active session: [1] crl@xxxxx.replaceme.com.au
===
i can verify files exist in this directory also, and it was executed in an elevated command prompt, logged in using domain administrator on the 2012 R2 server.
any suggestions or assistance is appreciated
thanks
i have tested the script and it does work from a (different directory) and on another pc (windows 8.1) but for some reason, it wont 'put' files referenced from that directory, any suggestions or steps i am missing? i searched around and wasnt able to find anything like my situation
ps: its used to upload crl's for our pki servers as part of the 2012 PKI infrastructure here.
script launch parameters:
c:\Program Files (x86)\WinSCP>winscp.com /script=c:\scripts\crl_transfer_pki.txt
===
script layout
===
# This script uploades the newly created CRLs To the PKI servers And overwrites existing files On the PKI Hosts
# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect to SFTP server PKI-01 using a password
open sftp://xxxxxxxx:xxxxx@xxxxx.replaceme.com.au/ -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
# Change remote directory *using a temp location*
cd /var/www/html/CertEnroll
# Upload file
put C:\Windows\System32\certsrv\CertEnroll\*.crl
#
# Disconnect
#
#
# Connect to SFTP server PKI-02 using a password
open sftp://xxxxxxxx:xxxxx@xxxxx.replaceme.com.au/ -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
# Change remote directory *using a temp location*
cd /var/www/html/CertEnroll
# Upload file
put C:\Windows\System32\certsrv\CertEnroll\*.crl
#
# Disconnect
close
# Exit WinSCP
exit
===
when run, this is the output:
===
batch abort
reconnecttime 120
confirm off
Searching for host...
Connecting to host...
Authenticating...
Using username "crl".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Session started.
Active session: [1] crl@xxxxx.replaceme.com.au
/var/www/html/CertEnroll
No file matching '*.crl' found. (System Error. Code: 3.
The system cannot find the path specified)
Searching for host...
Connecting to host...
Authenticating...
Using username "crl".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Session started.
Active session: [2] crl@xxxxx.replaceme.com.au
/var/www/html/CertEnroll
No file matching '*.crl' found. (System Error. Code: 3.
The system cannot find the path specified)
Session 'crl@xxxxx.replaceme.com.au' closed.
Active session: [1] crl@xxxxx.replaceme.com.au
===
i can verify files exist in this directory also, and it was executed in an elevated command prompt, logged in using domain administrator on the 2012 R2 server.
any suggestions or assistance is appreciated
thanks