This article is based on the requirement I recently encountered where I was required to monitor a specific exception type and if it occurred, the admins needed to be notified at the same time.
In this demo, I am considering a scenario in which if we ever encounter an Event ID “1101”, that would mean the SharePoint Site or any related service is down and in that case, the administrators will get email notifications automatically.

In order to accomplish this, let's start with writing a PowerShell function “Monitor-Event-Logs” as shown in Step 1 of the below image.
In Step 2, we are making use of “Get-EventLog” commandlet by instructing it to get the topmost of the latest application log where the Event ID = “1101”.
We can check for Event Object for null and if it returns the data, we prepare the Email Content consisting of relevant data in as shown in Step 3.
In Step 4, we are sending an email notification to the Administrators by using another generic function “Send-Email”.






Humayun Kabir MamunPosted Sep 30, 2017, 5:21 AM
Thanks Prashant for this nice article...