Troubleshooting Session Connection Failure
I have the following code:
And when I run this and see the session output I get the following:
# 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
Just wondering what people would recommend to troubleshoot what issue could be?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