参考:https://www.jianshu.com/p/3aada3708970
https://www.cnblogs.com/mycyl/p/7592675.html
Sub Main
Dim user, pwd
user = "用户名"
pwd = "密码"
Dim switchs(管理地址个数减去1)
switchs(0) = "172.16.x.x"
switchs(1) = " 192.168.x.x"
switchs(n-1) = " 10.100.x.x"
For Each swip In switchs
xsh.Session.Open ("ssh://" & user& ":" & pwd & "@" & swip)
xsh.Session.Sleep(50)
xsh.Screen.WaitForString ">"
xsh.Screen.Send "dis int brief "
xsh.Screen.Send VbCrlf
xsh.Session.Sleep 100
xsh.Session.Close()
Next
End Sub
标签:执行命令,relevant,Session,switchs,blog,pc,交换机,xshell,xsh From: https://blog.51cto.com/u_551173/5927814