PowerShell quick byte – Quick and Dirty way to ping bunch of IPs using PowerShell

I recently had situation where I needed to monitor bunch of IPs and log if any of them fail to respond. I know there are probably 1000 different ways it can be done but I needed something simple that I can setup quickly and give out to anyone to use without worrying too much about technical literacy level of that person. Enter the PowerShell… this being my darling scripting language, I decided to make use of that.

Now about script…

Script itself is very simple, it expects a list of IP addresses in a file called “IP_List.txt” with each IP in new line. Something like below,

192.168.8.2

192.168.8.3

 192.168.8.4

 192.168.8.5

Than script will go through each IP in list and ping them one after another. After each look, it will cool down for 1 second and start again. Since end conditions will never be satisfied, it will run  perpetually.

If any IP among the list is not responding it will be logged into file called “Ping.log”.

I have copied this script on my GitHub page.

That’s it for now…

Leave a Reply

Your email address will not be published. Required fields are marked *