I have multiple severs set up for clients where they have two servers and VM’s are replicated across for backup purposes and so downtime is reduced if the main server has hardware faults.
For whatever reason, sometimes the replication fails and needs to be reset and re synced manually from scratch with a few clicks. In these instances, you need to be notified so you can manually enable the replication to start again.
Step 1. Open up Task Scheduler
Step 2 – Created a New task, name it something like Email Alert For VM Replication Fail
Step 3 – Make sure it runs whether user is logged on or not see below screenshot:
Step 4 – Set the trigger to on event. Fill in the details as per below screenshot:
Step 5 – Set an Action to email yourself via powerscript. Make sure you select the clients ISP SMTP gateway that does not need authentication.
For the argument you need to edit this line to suit your needs.
The Event ID I have used gives me emails when the replication is critical and manually needs to be reset. If you want more alerts for even warnings you will need to add more schedules for more ID’s The following ID’s if you search in even log will give you the main ones. This article here mentions the main ones also.