«

»

Jun 29 2017

Print this Post

Ping all VMs in a Hyper-V Cluster

In a perfect world, everyone trusts that their VMs are working properly if Hyper-V or VMM are reporting that it is in a running state. However, sometimes we need to double check things using the most basic tool, PING!

In this post, we will walk through a few PowerShell snippets that do the following,

  1. Finds all VMs in a Hyper-V Cluster.
  2. Pings the VMs

Let’s get to work!

Find all the VMs in a Hyper-V Cluster

In this part we first select the desired Hyper-V cluster to work on, we do this using the Select-Item function which can be found here.

Then, we get a list of all the VMs that are currently running on the select Hyper-V cluster.

Now we have a list of the running VMs on each node in the cluster.

Ping all the VMs

What we do here, is we ping all IPv4 addresses assigned to each connected virtual network adapter. We use a function called Format-Color which can be found here.

The result will be something like the image below,

That’s all for Now!

Cheers.

About the author

Walid AlMoselhy

Permanent link to this article: http://almoselhy.azurewebsites.net/2017/06/ping-all-vms-in-a-hyper-v-cluster/

Leave a Reply

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