Xshell Forum

configuring multiple devices with script

Last post: Tuesday, June 9, 2015 4:14 AM by Luqmaan, 4 reply

 
Saturday, May 30, 2015 1:14 PM - Luqmaan

configuring multiple devices with script

 
Hello,
I'm new to Xshell and trying to figure out how I can configure multiple switches with Xshell using script. In case the only parameter that changes is a hostname and ip address? I have to configure up to 50 switches daily and want to make this process as automated as I can.
Thanks

Program Ver. : Xshell 5
Monday, June 1, 2015 5:05 AM - Support

Re: configuring multiple devices with script

 
Can you provide us with the following information?

1. What do you want to accomplish with Xshell? Please describe how you want to complete your tasks using Xshell.

2. Can you please describe how you want to use the script to work with switches?



---
Technical Support

Like us on Facebook
Follow us on Twitter
Wednesday, June 3, 2015 3:27 AM - Luqmaan

Re: configuring multiple devices with script

 
Thank you for your reply.
1. I'd like to learn Xshell in general as it was recommended to me by others. As for specific task, I'm trying to use written script to configure switches and to use Xshell for this purpose.
2. Basically, each switch gets a set of standard commands with only hostname and ip address variable. So I'm trying to automate process where I can run the same script and just change the variable interactively.
Friday, June 5, 2015 4:08 AM - tracky2015

Re: configuring multiple devices with script

 
you can use vbscript and some excel function to do it,2 excel :1 for device(include device type 、ip、local user.....etc...),another for command(include command line、wait for string、timeout.....etc...)。

some example for excel function(1000 lines will be read into memory while use it):

Function ReadFile(sFileName,sSheetName)
Dim oExcel
Dim oSheet
Dim oRange
Dim arrRange

On Error Resume Next
' create Excel object
Set oExcel = CreateObject("Excel.Application")
If err.Number <> 0 Then
MsgBox "init Excel Failed" & vbCrLf & _
"please make sure the Excel app have been setup", vbCritical
Exit Function
End If
On Error Goto 0

On Error Resume Next
' open Excelfile
oExcel.Workbooks.Open(sFileName)
If err.Number <> 0 Then
MsgBox "Can't open Excel file" & vbCrLf & _
"Please check your Excelfile path", vbCritical
Exit Function
End If
On Error Goto 0

' read data into memory
Set oSheet = oExcel.Worksheets(sSheetName).UsedRange
' From A to Z,get 1000 lines data
Set oRange = oSheet.Range("A1:Z1000")
'format data to array
arrRange = oRange.Value
' close excel file
oExcel.WorkBooks.Item(1).Close
' quit Excel
oExcel.Quit
Set Excel = Nothing
' return Excel data
ReadFile = arrRange
End Function
Tuesday, June 9, 2015 4:14 AM - Luqmaan

Re: configuring multiple devices with script

 
Thank you, tracky2015, it was helpful. Hopefully I can figure out how to automate this task in a better way.