Jump to content

TrenalFrenal

Members
  • Posts

    2
  • Joined

  • Last visited

TrenalFrenal's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. First off, I am a scripting novice and you'll be able to tell by the example. A co-worker of mine is responsible for the patch management of multiple customers with multiple locations per customer. We are having some bandwidth issues related to patch management at some of the locations and I wanted to come up with a way to download the updates we need to push out to a central machine at those locations and push the updates from that device. My first attempt at a push script is below, obviously it isn't built for multiple machines yet but I wanted to verify that I am deploying the updates the best way possible. I was hoping someone could point me in the right direction for the remote deployment. Thanks in advance. $a = InputBox ("Share", "Please enter share path", "") $b = InputBox ("XP Machine Name", "Enter Machine Name", "") $i = 1 FileInstall("D:\Patches\winxp.txt", "C:\winxp.txt", 1) Sleep (500) FileInstall("D:\Patches\psexec.exe", "C:\psexec.exe", 1) Sleep (500) $file = FileOpen("C:\winxp.txt", 0) Sleep (500) RunWait(@ComSpec & " /c " & "net use r: " & $a) Sleep (500) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf While $i = 1 Patch() $i = $i + 1 Wend Func Patch() While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop RunWait(@ComSpec & " /c " & "r:\psexec.exe \\" & $b & " -c " & "r:\" & $line & " /quiet /norestart") Wend EndFunc RunWait(@ComSpec & " /c " & "net use /d r:") FileClose($file)
  2. 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.
×
×
  • Create New...