powershell - Fatal: Server unexpectedly closed network connection -


i trying run following command sql server agent job upload daily files our ftp server. tried connection local utility winscp 5.1.5 , connection ftp succeeds without problems, connection attempt script fails (following code , error). can me in right direction please?

$error.clear(); $csv_file = "filepath" $sftp_cmd = "c:\psftp.exe"  $user = "testuser" $pass = "pwd" $hst = "ftp3.xyz.com" $cmd = @(   "put $csv_file",   "bye" )  $cmd | & $sftp_cmd -pw $pass "$user@$hst" -batch 

i getting error

fatal: server unexpectedly closed network connection.

the command working fine me. however, question suggests you're trying connect ftp server. winscp can handle both scp/sftp , ftp connections, knowledge psftp supports sftp (a file transfer protocol based on ssh, not confused ftps).

if server not ssh server, need ftp client data transfer (e.g. ftp.exe shipped windows). if server ssh server, try running psftp option -v more information, , check logs on server.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -