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

Author Message
swgarasu2

Guest


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: (Smile [], 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: (Smile [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException



WinSCP version that shows when I click "help" is 5.5.6
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
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.
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...

Very Happy
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License