![]() # setup transfer options $transferOptions = New-Object WinSCP.TransferOptions SshHostKeyFingerprint = " enter SshHostKeyFingerprint string here " The automation can be handled using Windows task scheduler.Īdd-type -Path ' C:\Program Files (x86)\WinSCP\WinSCPnet.dll' $sessionOptions = New-Object WinSCP.SessionOptions -Property = ::Sftp During a call, it picks a file from the remote location to Local server. You can have an automation to call this file periodically.Once a connection is established, WinSCP is able to obtain the HostKey, which it validates often. ![]() Obtain the authentication credential from server administrator.Also note that both machines need to be turned to allow communication. I have also called the WinSCPnet.dll library to be referenced to the kind of connection I am using. In my case, this solution has been used on a Windows machine where the WinSCP software is installed. It is a very secure process because a password, username and an SsHostKeyFingerprint is required for authentication purposes. It is very useful as it is a secure way to move files from one remote location to another, especially when used over SFTP. The code will help you copy files from one location to another.
0 Comments
Leave a Reply. |