因安全规则要求,必须定期修改交换机密码, 而交换机数量多,所以配置了一个脚本远程自动修改。
脚本命令如下:
# $language = "VBScript"
# $interface = "1.0"
' Connect to an SSH server using the SSH2 protocol. Specify the
' username and password and hostname on the command line as well as
' some SSH2 protocol specific options.
Sub Main
Dim user
user = "***" 'ssh登录设备时的用户名
Dim passwd
passwd = "*******" ’ssh登录的密码
Dim superpwd
superpwd="******" '原来super3的密码
Dim fso,file,host
'打开保存设备管理地址文件
Const ForReading = 1,ForWriting = 2
Set fso = CreateObject("Scripting.FileSystemObject")
'定义一个ip列表文档,将所有交换机的ip地址单独列出,表格无需任何格式,只用每行一个ip地址就可以
Set file = fso.OpenTextFile("D:\办公文档\运维管理\修改交换机su