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

Advertisement

jobins
Joined:
Posts:
1

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

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
Location:
Prague, Czechia

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.

Reply with quote

Advertisement

You can post new topics in this forum