Session.Open Timeout Issue

Advertisement

lloftus
Joined:
Posts:
2

Session.Open Timeout Issue

The following code snippet will timeout while trying to open the session with our vendor. We have confirmed via Wireshark that their server will see the initial request but nothing after that.

There is more code after the Session.Open but I have not included it in the snippet as it never gets to run due.
# Load WinSCP .NET assembly
Add-Type -Path "C:\Program Files (x86)\WinSCP\WinSCPnet.dll"
 
# Set up session options
$sessionOptions = New-Object WinSCP.SessionOptions -Property @{
    Protocol = [WinSCP.Protocol]::Sftp
    HostName = "sftp21-cmh.sumtotalsystems.com"
    UserName = "cust_mmm_Dozuki"
    Password = "YVCbf-X0"
    SshHostKeyFingerprint = "ssh-rsa 2048 k8L86hrEaiZl+v/f+Wu1Lo/lgNuqkcWZqSi/iF1iKzl"
}
 
$session = New-Object WinSCP.Session
$session.SessionLogPath = "C:\Dozuki_Files\Scripts\_automatedScripts\winscp.log.txt"
try
{   
    # Connect
    $session.Open($sessionOptions)
}
finally
{
    $session.Dispose()
}
Description: Log file from 7/17/2025

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
42,276
Location:
Prague, Czechia

Re: Session.Open Timeout Issue

Can you connect with WinSCP GUI or with any other SFTP client? (running on the same local machine).
If you can, please post its log file too.

Reply with quote

martin
Site Admin
martin avatar

Re: Open Call in Powershell not working

And can you connect with any other SFTP client? (i.e. does your SFTP server work at all?)

Reply with quote

Advertisement

You can post new topics in this forum