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: Troubleshooting Session Connection Failure

Your connection details are either wrong or you do not have network connectivity to the server.
Hard to be more specific, as you didn't really tell us anything about the server, where you do the connection details from, or why you believe you should be able to connect.
Can you connect anyhow? Using WinSCP GUI? Using any other client? From any other machine? ...
jay8769876

Troubleshooting Session Connection Failure

I have the following code:
# Set up session options
$sessionOptions = New-Object WinSCP.SessionOptions -Property @{
    Protocol = [WinSCP.Protocol]::Ftp
    HostName = $mySite
    UserName = $Userword
    Password = $Password
}
 
$session = New-Object WinSCP.Session
 
# Connect
$session.Open($sessionOptions)
 
Write-host $session.Output

And when I run this and see the session output I get the following:
Exception calling "Open" with "1" argument(s): "Connection failed.
Timeout detected. (control connection)
Connection failed."
At line:37 char:5
+ $session.Open($sessionOptions)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : SessionRemoteException

winscp> option batch on batch on reconnecttime 120 winscp> option confirm off confirm off winscp> option reconnecttime 120 recon
necttime 120 winscp> open "ftp://myusername:***@mysite.ca" -passive=1 -timeout=15 Connecting to mysite.ca ... Connection failed.
Timeout detected. (control connection) Connection failed. winscp> exit

Just wondering what people would recommend to troubleshoot what issue could be?