Advanced Hyper-V Replica Monitoring via PowerShell

This script will check first Hyper-V Replica TCP listener on Port 80, because Hyper-V Replica requires HTTP and HTTPS rules to be enabled in Windows Firewall, and then e-mail the Replication State, Replication Mode, the Target frequency of the replica, etc...

 
 
 
 
 
4.6 Star
(5)
3,070 times
Add to favorites
Servers
12/19/2016
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Great script
    1 Posts | Last post July 15, 2019
    • Hi Charbel,
      
      thank you. I love your script. Works well in a workgroup environment with replica server beeing hyper-v server 2016.
      
      Had to change the port to 443 and allow the windows firewall rules for "Remote Event Log Management".
      
      Also I added the 'TimeCreated' property to the Event Log summary.
      
      
      Greetings
      Michael
  • Support to send email with STARTTLS
    1 Posts | Last post September 12, 2018
    • Hi Charbel, thanks for the script.
      
      I´m only having problem with the authentication with smtp server. I tried google and Office 365 and both say i need to authenticate with STARTTLS.
      Is there any option to do that ?
      Thanks
  • Cluster Replica Broker
    1 Posts | Last post November 04, 2017
    • Thanks for the script. Does this work for a scenario with a primary on a cluster using a broker, replica on non clustered server and extended replica on another non clustered server?
      I did some test updating $PrimHyperV01 with the broker's name and so forth. I see the connection test successful but nothing else happens, even though I paused a Replication to set a system in warning state.
      In a different post it was mentioned v3.0 would support brokers.
  • Test-NetConnection
    1 Posts | Last post October 23, 2017
    • Dear Charbel
      
      I really want this script to work however I keep getting the error below:
      
      PS C:\> .\Get-HyperVReplicaHealth.ps1
      Test-NetConnection : The term 'Test-NetConnection' is not recognized as the
      name of a cmdlet, function, script file, or operable program. Check the
      spelling of the name, or if a path was included, verify that the path is
      correct and try again.
      
      Here is my Windows and Powershell version:
      
      OS Name:                   Microsoft Hyper-V Server 2012
      OS Version:                6.2.9200 N/A Build 9200
      
      PS C:\> $PSVersionTable.PSVersion
      
      Major  Minor  Build  Revision
      -----  -----  -----  --------
      5      1      14409  1005
      
      Please can you assist?
      
  • tcp connection failed
    5 Posts | Last post October 20, 2017
    • Hello
      
      i have problems with the connection to some servers, the http listener rules are activated in the windows firewall but still getting this error,
      
      no other av software is installed tried to disable firewall via services this didn't help i tried to open the port 80 manually this also didnt help
      
      do you have any suggestions?
      
      thank you
    • Thank you Keeeniiic for your feedback,
      
      Could you please share the screenshot of the error?
      What about port 443?
      
      Cheers,
      -CN
    • Same here... 
      Our Hyper-V replication uses 443, not 80. Therefore the script fails.:
      
      PS C:\tools> .\Get-HyperVReplicaHealth.ps1
      WARNUNG: TCP connect to hyper-v-1.lab.local:80 failed
      WARNUNG: TCP connect to hyper-v-1.lab.local:80 failed
      WARNUNG: TCP connect to hyper-v-1.lab.local:80 failed
      PS C:\tools>
      
      C:\Windows\system32>netstat -a | find ":480"
      
      C:\Windows\system32>netstat -a | find ":443"
        TCP    0.0.0.0:443            Hyper-V-1:0           LISTEN
        TCP    [::]:443               Hyper-V-1:0           LISTEN
      
      Matthias
    • Hi,
      
      First of all - great work Charbel!
      port check does not work when using Hyper-V CORE (2012 R2 in my case).
      I changed it do PING instead (yes, my CORE is ping enabled) and it works a treat.
      
      Ive also added reporting on NORMAL state of replication, for my peace of mind.
    • Hi Matthew
      
      I am having the same issue on my Hyper-V Server 2012.
      
      PS C:\> .\Get-HyperVReplicaHealth.ps1
      Test-NetConnection : The term 'Test-NetConnection' is not recognized as the
      name of a cmdlet, function, script file, or operable program. Check the
      spelling of the name, or if a path was included, verify that the path is
      correct and try again.
      
      I can't the ping to work. Could you perhaps share with me how you resolved?
      
      
  • Need without resume feature
    2 Posts | Last post May 09, 2017
  • Resume only on warning
    1 Posts | Last post April 19, 2017
    • Hi firstly great script, this should be part of gui Hyper-V manager, but just one small change i made and it seems to work better, if you remove the -Resynchronize from Resume-VMReplication on the warning section, as if its in a warning state it doesnt need a time consuming -Resynchronize only a plain old resume (only needs a resync usually when critical) this can save minutes/hours depending on size of VM/Bandwidth so its much better, i may stand corrected but it works fine on my clusters and standalone s when VM replica goes off the rails
      
      Hope this helps
      Senan
  • Replica Broker
    3 Posts | Last post April 03, 2017
    • Hello , 
      
      Is this script supports a scenario where source is a single hyper-v host and destination is a failover cluster with replica broker ? 
      
      
      Thanks
    • Thank you Psomas for the feedback!
      At the moment, this script does not support this scenario.
      I will try to address it in the next update.
      Thanks,
      -Charbel
    • Thanks for your answer and for the effort ! 
  • Reporting
    2 Posts | Last post April 02, 2017
    • Hi
      
      Does the script only email you upon failures or issues with the replication?
    • Hello Navishkar,
      
      Yes, the script will only email you upon warning and failures with the replication.
      
      Thanks,
      -Charbel
  • Is there a way to differentiate between VMs that just need to send updated data and VMs that need resynchronization?
    3 Posts | Last post January 02, 2017
    • Would like to run this every hour or so, but I don't want machines re syncing during business hours. Any ideas on modifying so there is a version that resumes replication only if the VM does not need re-sync?
    • Actually, in my testing, the VM is defaulting to re-sync even when not needed. For example if I pause replication for a few minutes on a VM, and run the script, it kicks off a resync process.
    • Disregard, I figured it out in the script. Thanks for the nice work
1 - 10 of 16 Items