Monitoring Hyper-V Replica on a Failover Cluster

Recently we enabled Hyper-V Replica between two of our Windows Server 2012 R2 Datacenter Clusters.
In the first days I was checking the replication of theVMs manually using a PowerShell one-liner.

Eventually I got tired of that, so I searched a little bit and found a PS Script (not sure where) and customized it to fit my needs.

When executed on one Cluster Node (could also be a standalone machine), the script gathers information regarding the replication and sends it via Mail to me:


In order to automate the sending of the report, I created a scheduled task on one Cluster Node, following the settings:


  • Name: ReplicaMail
  • User: replica (restricted service user)
  • Run whether user is logged on or not
  • Run with highest privileges
  • Configure for: Windows Server 2012 R2


  • Run Daily
  • Stop task if running longer than 3min


  • Start a program:
    • Program: %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
    • Arguments: .\MailRepHealth.ps1 -to -from -smtpserver -hostorclustername clustername -iscluster
    • Start in: C:\tmp\       (this is the location of the script)

Now this is pretty much all the configuration needed to do, except saving the script on your server. Here it is (please save it in .ps1 format:


Please note that I’m not responsible for any issues caused by running PowerShell scripts on your systems.
Read the script, make sure you test it and you are ready to use it.


I'm a Systems Engineer working for an IT-Service Provider in Frankfurt am Main, Germany. I am specialized in Virtualization, High Availability, Storage- and Server Administration. In my free time, I like spend time with my lovely wife, to do sports like jogging and biking. I enjoy movies and a good bottle of fermented grape juice.

Tagged with: , , ,
Posted in Server, Virtualization, Windows Server 2012 R2

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: