Email alert using PowerShell when a windows service failed

12:25 AM 3 Comments

You can use Windows PowerShell to send you an email notification when a windows service failed.  Here are the steps:
1. Open Windows Services by doing start –> Run –> Services.msc

2. Right Click on the Service and go to Properties and chose Recovery tab

3. Select Run a Program

image
In the Run Program below type
C:\Windows\System32\Windows PowerShell\v1.0\PowerShell.exe
In the Command line type the following
&  "Send-Mail Message –To visionabove@gmail.com -Subject \"Service Failed\" -Body \"Please Action\" -SmtpServer YOURSMTPSERVER -From visionabove@gmail.com"

Click on Apply and OK. 

Go to Task Manager and end the Process.

You should receive an email

3 comments:

Thank you for your comments