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()
}
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()
}