Use PowerShell to check a TCP port status and restart the accompanying service if necessary.
- Define the service that we are checking and the IP and port it should be listening on.
- Define the SMTP server you want to use to notify yourself when the service attempts to restart.
- Define the number of attempts you want to make.