I'm trying to use a Technet Powershell script to check the status of various services on a few servers. (The script can be found here: https://gallery.technet.microsoft.com/scriptcenter/PowerShell-Monitor-Notify-a5fe1538
) It involves a call command that specifies servers and services to be checked, and a function that actually checks the services and then inserts the results in an html table. Not being very familiar with Powershell, I'm not sure how to set this up. I've tried to call the function as mentioned in the article:
.\Get-ServiceSQLAlert.ps1 -ComputerList "C:\Fave_PowerShell_CMDlets\ServiceWatch.txt" -includeService Spooler -To firstname.lastname@example.org -From ServiceWatch@acme.com -SMTPMail mail.acme.com
But when I do nothing happens - no error, no nothing. It seems like it runs but no htm file is created and no email is sent. Is there anyway to troubleshoot this?
- I have write access to the C drive
- I'm calling the function from the correct path
- The path for the text file containing the server names is correct
- On the server I'm using to test, I have shutdown the spooler service