Troubleshooting Session Connection Failure

Advertisement

jay8769876
Joined:
Posts:
3

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?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,605
Location:
Prague, Czechia

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? ...

Reply with quote

Advertisement

You can post new topics in this forum