Can't connect to server using winscpnet.dll - winscp client works

Advertisement

swgarasu2
Guest

Can't connect to server using winscpnet.dll - winscp client works

Hi there,
I have spent several hours researching powershell examples for using winscp- I can connect to the server and transfer files with the winscp client, but I cannot get it to work with powershell- I keep getting the following error

Exception calling "Open" with "1" argument(s): "Connection has been unexpectedly closed. Server sent command exit status 0."
At C:\temp\ftptest.ps1:19 char:14
+ $session.Open <<<< ($sessionOptions)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException

I’ve tried it by directly trying to open a session within powershell (vs. using a script) and get the same error-

PS C:\Users\myself> $session.Open($sessionOptions)
Exception calling "Open" with "1" argument(s): "Connection has been unexpectedly closed. Server sent command exit status 0."
At line:1 char:14
+ $session.Open <<<< ($sessionOptions)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException



WinSCP version that shows when I click "help" is 5.5.6

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,426
Location:
Prague, Czechia

Re: Can't connect to server using winscpnet.dll - winscp client works

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

swgarasu2
Guest

Ah! being able to log the session showed me what was going on- wrong password- I had made a typo. Thank you very much for the help! Hurdle 1 cleared, onto hurdle 2...

:D

Reply with quote

Advertisement

You can post new topics in this forum