Multiple Server Ping

May 5th, 2008 Categories: Sharing Info

If you ever need to do Ping to multiple server from your workstation, Here I have a easiest solution for you.

Step 1 – Create Multiple Server Ping.bat or any other name and with .bat extension.

Step 2 – Copy & Paste below coding to the .bat you created and Save it.

@echo off 

setlocal 

if exist "output.txt" del "output.txt" 

for /f "tokens=*" %%a in ('type servers.txt') do (
  for /f "tokens=*" %%b in ('ping -n 1 %%a ^| findstr /c:"could not find host"') do echo %%a was unreachable>>"output.txt"
) 

echo Output in output.txt
pause

Step 3 – Create a New file and rename it to servers.txt.

Step 4 – List all the server you wanted to Ping into servers.txt.

Example:

PS2VMIONDEV
PS2VMIONDEV1
PS2VMM2GAPPDEV
PS2VMM2GAPPSIT

Step 5 – Put these two files into a same folder and Double click on the .bat file you created to start the Ping to multiple Servers.

For future use, just simply replace the servers name into servers.txt and Double click on the .bat file you created to start the Ping to multiple Servers.

You will ask, how to know if that particular server not pingable? This script will creat a file called output.txt to output all the error result. Once the script ran completed, you can check on the output.txt to identify which server was down.

Easy? I have use this script to ping for hundreds of Server in company.

Your IP Address is:
38.107.179.216

Tags:
No comments yet.

Leave a Comment