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:
FOR /F %%S IN (SERVERS.TXT) DO (
ECHO %%S >> OUTPUT.LOG
TRACERT %%S | Findstr "firewall -f-" >> output.log
)
Above script gives below output:
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.