Post a reply

Options
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)

Options

Topic review

OuchMySpleen

Issues with Authentication

I've had powershell script running great for years, but the server I'm sending to recently change our credentials and now it is no longer working. Using the gui it works fine, but the script fails during login. Looking at the log it accepts the sshHostKey so that isn't it, which leads me to believe it may be the password as our new one has special characters that I may need to escape out or something. The password is something like c$1234Abc+t could the + be causing issues? I know that could be interpreted as a concatenate.

$sessionOptions = New-Object WinSCP.SessionOptions

    $sessionOptions.Protocol = [WinSCP.Protocol]::Sftp
    $sessionOptions.HostName = "sftp.ourclient.net"
    $sessionOptions.UserName = "myuser"
    $sessionOptions.Password = "c$1234Abc+t"
    $sessionOptions.SshHostKeyFingerprint = "ssh-rsa 2048 blahblahblah"