Issue connecting via SFTP to dropbox using Powershell

Advertisement

stwainer
Joined:
Posts:
3
Location:
Here

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 = "dropbox.xxxx.com"
    UserName = "xxxxxx"
    Password = "xxxxxxx"
    SshHostKeyFingerprint = "xxxxxxxxxxx"
    
}
$sessionOptions.AddRawSettings("TryAgent", "0") 
$sessionOptions.AddRawSettings("FSProtocol", "2")

$session = New-Object WinSCP.Session

Log file attached

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
31,609
Location:
Prague, Czechia

Re: Issue connecting via SFTP to dropbox using Powershell

Can you post a log file from WinSCP GUI too?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
31,609
Location:
Prague, Czechia

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

Reply with quote

stwainer
Joined:
Posts:
3
Location:
Here

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.

Steve

Reply with quote

Advertisement

You can post new topics in this forum