I am currently using the following simple script to run remote commands to Cisco ASAs with Plink and dumping them out to a text file.
dim $userName, $deviceAddress, $userPassword, $commandFile
$userName = Inputbox("userName", "Enter the device's userName :", "")
$userPassword = Inputbox("userPassword", "Enter the device's Password :", "", "*")
$deviceAddress = Inputbox("deviceAddress", "Enter the device's Address :", "")
$commandFile = Inputbox("commandFile", "Enter the Command file :", "command.txt")
$outputFile = Inputbox("outputFile", "Enter the Output file :", "output.txt")
Run(@ComSpec & " /c " & "C:\plink\plink.exe -ssh -l " & $username & " -pw " & $userPassword & " -m " & $commandFile & " " & $deviceAddress & " > " & $outputFile, "", @SW_HIDE)
The $commandFile looks like this:
enable
Password
show start
exit
This works perfectly for what I am doing one device at a time but I am looking at scripting this for all our customers, which is over 200 devices. Is there any way to create a text file on the fly for the $commandFile so that I can use a variable for the enable password? I'm not familiar with GUIs but my vision would include an input area where the commands could be typed and just run from that.
Thanks.