login about faq

I'm using ChilkatDotNet2.dll to connect to a sftp server, the connection to the server is established but the authentication fails when it is run automatically. if we run the script manually it works.

here is the part of the script I'm having trouble with.

$sftp is a new Chilkat.SFtp object. The other variables have hardcoded values earlier in the script and contain server information and user login/pass.

    $tryCount = 0
    do {
    $successCon = $sftp.Connect($sftpHostname,$sftpPort)
    if ($successCon -eq $true){
        $successAuth = $sftp.AuthenticatePw($sftpUser,$sftpPass)
        if ($successAuth -ne $true){
            $sftp.Disconnect()
        }
    }
    $tryCount++
    }
    while(($successCon -ne $true -or $successAuth -ne $true) -and $tryCount -le 3)

As I said, there is an automated task manager that executes scripts at certain times of the day automatically, and when they are automatically run, this script fails to pass the $sftp.AuthenticatePw check, but if I run the script manually, it works. Can anyone point me in the right direction as to what might be wrong?

asked Apr 17 '14 at 15:33

mmeopn's gravatar image

mmeopn
1111


usually a permissions problem, make sure the scheduled job User has appropriate permissions and that the ports are accessable.

link

answered Apr 18 '14 at 11:45

cdlvj130's gravatar image

cdlvj130
9691017

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×200
×3

Asked: Apr 17 '14 at 15:33

Seen: 906 times

Last updated: Apr 18 '14 at 11:45

powered by OSQA