#1
|
|||
|
|||
![]()
Please suggest me how to differentiate the SSH failure and authendication failure on the below script.
ConnectionString = "/SSH2 /L " & strUsername & " /PASSWORD " & strPassword & " /AcceptHostKeys "& strCurrentHostname crt.Session.Connect ConnectionString On Error Resume Next. |
#2
|
|||
|
|||
Hi Lukesh,
Thanks for the question. You can use the following code to determine what error is being returned: Code:
On Error Resume Next crt.Session.Connect strConnectInfo ' Capture the error code and description (if any) nError = Err.Number strErr = Err.Description ' Restore normal error handling so that any other errors in our ' script are not masked/ignored On Error Goto 0 What problem are you trying to solve? |
#3
|
|||
|
|||
Hi Lukesh,
I was wrong. It is not possible to successfully determine authentication failure using On Error Resume Next with the Connect method, but it should work for connection failures. It would be necessary to handle the authentication in the terminal window to capture what might be happening. You can find an example of how to do this in the following post: http://forums.vandyke.com/showthread...7087#post37087Does this help you accomplish your goal? |
![]() |
Tags |
authendication , lukesh , ssh |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | Rate This Thread |
|
|