Post a reply

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)


Topic review


Thanks for your help. Basically the SFTP receiver was limiting the IP's that could connect. I didn't realize that since it worked from *my* PC and thought it was a code issue.


The logs are from different machines. Can you use WinSCP GUI on the same machine that runs your code? With the same local account?

Here's a log file from the utility.

Thanks in advance for the help.

Re: Issue connecting via SFTP to dropbox using Powershell

Can you post a log file from WinSCP GUI too?

Issue connecting via SFTP to dropbox using Powershell

I'm successfil using the standard winSCP app in connecting and uploading files, but have issues connecting with the following code:
# 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 = ""
    UserName = "xxxxxx"
    Password = "xxxxxxx"
    SshHostKeyFingerprint = "xxxxxxxxxxx"
$sessionOptions.AddRawSettings("TryAgent", "0")
$sessionOptions.AddRawSettings("FSProtocol", "2")

$session = New-Object WinSCP.Session

Log file attached