Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: WinSCP Powershell script getting error on first 2 or 3 times then starts working

Please post full session log files from failing and working session.
jobins

WinSCP Powershell script getting error on first 2 or 3 times then starts working

Hi,

I am getting below error when I run the script for 2 or 3 times then the connection is success full and everything starts working. Then after an idle time the same issue happening.
Exception calling "Open" with "1" argument(s): "Connection has been unexpectedly closed. Server sent command exit

status 0.
Authentication log (see session log for details):
Using username "shakcorp".
Server refused our key.
Authentication failed."
At C:\payment-upload-scripts\payment_upload_script.ps1:59 char:7
+                         $session.Open($sessionOptions)
+                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : SessionRemoteException