Securecrt Script Loop

Script Menu SecureCRT. Previous page next page Script Menu. This topic lists the options available on the Script menu. Opens the Select Script to Run dialog where you can choose and start a script. For more information on scripts, see Creating ActiveX Scripts.

Attached to this post is a simple script which connects over either Telnet or SSH to a list of devices and resets the enable password, local password for the vty lines, and the console password. The script will login either with a username/password pair or with just a password. The script is setup to work with Cisco IOS devices, but customizing it for CatOS or some other vendor would not be difficult.

Sets the logfile name and enables logging from a script. Simulates pressing a function key. Uploads a text file to a server by sending it line by line and directing output to a file. Uses the Get function to read data from the screen and uses OLE automation to write data to an Excel file. If the result of this is OK, continuos the script, with a write command for example. If the result is not OK, the command to check must be launched with a one minute interval until the router is ok, Do not know how this loop, in the first loop. Can you help me.

Hi All, im working as WAN edge engineer and still telnet/ssh manually to device. I'm new and studying python to automate things but most of the videos i watched is using either mac or ubuntu as host pc. My office laptop is using windows and i cannot bring other pc inside our office. Download securecrt.tlb type library. Automates setting the DISPLAY shell variable to enable remote display of X clients. Sets the logfile name and enables logging from a script. Simulates pressing a function key. Uploads a text file to a server by sending it line by line and directing output to a file.

SecureCRT has a handy automation API which lets you build on the protocol support in it to automate tasks over the protocols it supports. As a Windows user, I don’t have things like Perl or an Expect shell readily available, but, I do have SecureCRT and VBScript. I wasn’t able to find much in the way of samples for this particular SecureCRT feature aside from the manufacturer’s webpage, so I thought I would share one I made.

Securecrt Script Loop Example

There are a series of constants at the top of the file where the applicable credentials should be specified. The devices.txt path is set to c:scriptsdevices.txt. You can modify this to your liking.

The syntax for each line in the devices.txt is:

Hostname;IPOrFQDN;Protocol

Hostname isn’t actually used, but it’s there if you want to add logging or something like that.

Securecrt Vbs

Protocol can be Telnet, SSH1, or SSH2.

The script and a sample devices.txt is attached in the zip below. The usual bit applies – it’s not my fault if something breaks. I’ve used this several times to mass change passwords and had it work every time, but I offer no guarantees. Enjoy.

A small script to paste script / commands to SecureCRT
Very helpful if needed to paste alot of lines to network devices

Securecrt

With normal paste not all the characters paste if there are alot of lines