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
Steve
# 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