Implementing variables for telnet credentials

6 posts · Closed

rmpf2 Guest
25 Nov 2020

I have some scripts using the built-in telnet option. In each one there's a declaration for user and password to access the device. Any idea or advice on how to implement some kind of variable for the credentials? If the user or password change, all the scripts have to be manually modified.

Example:

'Retrieve system info via Telnet
'This example code can be adapted to work
'with any device that supports the protocol

'Set credentials
user = "user1"
pass = "user1_password"

'Create internal Telnet object
set objTelnet = Internal.CreateObject("Telnet")
Andrew SoftPerfect
26 Nov 2020

One way would be to store login settings in an external file, e.g. XML or plain text and read that file to access the credentials.

Another way, we may add a function to access the Network Scanner's credential manager from scripts, though the problem is identifying which user and password to use. The list of credentials simply consists of username-password pairs, and I am not sure how to specify in a script which user you want if two of them have the same name.

rmpf2 Guest
26 Nov 2020

Hi. Happy Thanksgiving Day. God bless you all!

You mentioned earlier the possibility to implement some kind of function to access the credential manager. How about a function to access the applications variables definition?

Andrew SoftPerfect
30 Nov 2020

Yes, that can be done and we'll implement it soon.

At moment the Network Scanner application is undergoing a redesign with the aim of supporting both Windows and macOS to the maximum possible extent. To avoid having to merge new changes from different codebases, we'll add the requested feature once the redesign is complete (in ~2-3 weeks),

rmpf2 Guest
28 Nov 2022

With the new credential manager tag implementation would it be possible to use it on scripts using the built-in telnet option?

Would it be possible to define credentials for the Remote Performance Option?

Right know it appears to be using just the current credentials.

Andrew SoftPerfect
28 Nov 2022

For scripts you can now use the same tag system, e.g.:

'Set credentials
user = Input.Username("tag")
pass = Input.Password("tag")

For Remote Performance, I am afraid the Windows API doesn't offer custom authentication and uses the current user account.

This topic is closed. It has had no new posts for over a year, so the software versions it talks about may be out of date. Start a new topic in Network Scanner if you have a similar question.