One of the most popular posts on this blog has been the blog on setting up an Internal SMTP Service for SMBs that need to send server reports and support emailing from Internal devices that have move to cloud based email services.
One of the issues with this service is that is occasionally stops. There does not appear to be any reason why it stops, but it does. Restarting the SMTPSVS service does not restart the service, because it is based on IIS6.
Good news! You can use powershell to script the restart of this service.
Open an Administrative PowerShell window.
To Start the SMTP Virtual Server, type the following:
$SMTP=[adsi]"IIS://localhost/SMTPSVC/1" $SMTP.ServerState = 2 $SMTP.SetInfo()
To Stop the SMTP Virtual Server, type the following:
$SMTP=[adsi]"IIS://localhost/SMTPSVC/1" $SMTP.ServerState = 4 $SMTP.SetInfo()