SecureCRT批量创建及导入session

Step 1: 准备工作

VB脚本及Py脚本下载连接, 建议直接使用VB脚本,不用配置Python 环境.

VB脚本:ImportArbitraryDataFromFileToSecureCRTSessions(pre-v9.0,post-v7.2).vbs.txt

修改下后缀为vbs,打开脚本看下配置文件:

' The first line of your data file should contain a comma-separated (or whatever
' you define as the g_strDelimiter below) list of supported "fields" designated
' by the following keywords:
' -----------------------------------------------------------------------------
' session_name: The name that should be used for the session. If this field
'               does not exist, the hostname field is used as the session_name.
'       folder: Relative path for session as displayed in the Connect dialog.
'     hostname: The hostname or IP for the remote server.
'     protocol: The protocol (SSH2, SSH1, telnet, rlogin)
'         port: The port on which remote server is listening
'     username: The username for the account on the remote server
'    emulation: The emulation (vt100, xterm, etc.)
'  description: The comment/description. Multiple lines are separated with '\r'
' =============================================================================
'
'
' As mentioned above, the first line of the data file instructs this script as
' to the format of the fields in your data file and their meaning.  It is not a
' requirement that all the options be used. For example, notice the first line
' of the following file only uses the "hostname", "username", and "protocol"
' fields.  Note also that the "protocol" field can be defaulted so that if a
' protocol field is empty it will use the default value.
' -----------------------------------------------------------------------------
'   hostname,username,folder,protocol=SSH2
'   192.168.0.1,root,_imported,SSH1
'   192.168.0.2,admin,_imported,SSH2
'   192.168.0.3,root,_imported\folderA,
'   192.168.0.4,root,,
'   192.168.0.5,admin,_imported\folderB,telnet
'   ... and so on
' =============================================================================

脚本提供了多个变量名,并提供了一个example, 所以我们 照着这个新建一个txt文件,用来保存设备信息, 如下:

Step 2: Run scrip

Script – > Run _> 选中刚刚下载的脚本, 脚本开始执行会弹窗让你选择导入设备信息, 这时候选择上一步新建的那个设备信息文件.

Step 3:为Telnet设置用户名密码:

如下图,生成的session, 在文件夹上右击会对所有session 进行操作。

输入相应的提示符, 对应的用户名/密码.

Tags:

           

No comments

Comments feed for this article

Reply

Your email address will not be published. Required fields are marked *