Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Script to tracert multiple computer names and find specifc text

$
0
0

I'm looking for a script to tracert multiple servers and find a specific text in tracert output and get output as csv.
Below is what I have:

@ECHO OFF
FOR /F %%S IN (SERVERS.TXT) DO (
ECHO %%S >> OUTPUT.LOG
TRACERT %%S | Findstr "firewall -f-" >> output.log
)

Above script gives below output:

server1
  4     1 ms    <1 ms    <1 ms  site1firewall [10.2.2.1] 
server2 
  4     1 ms    <1 ms    <1 ms  site2firewall [10.2.22.1] 
server3

I want to tweak this script:

1. Verify if server is alive/accessible before running tracert
2. Output in table format (in single line)

Can somebody help?

Thanks.



Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>