Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!
all groups > iis smtp nntp > february 2005 >

iis smtp nntp : Restart SMTP automatically?


Dan
2/28/2005 9:20:16 AM
Is there any command we can use in scheduled task to restart the IIS SMTP
server automatically without restarting Websites & FTP?

I check IISreset command, but no parameter to restart SMTP only.

Jeff Henkels
2/28/2005 1:48:23 PM
[quoted text, click to view]

Go into Control Panel/Administrative Tools/Services & bring up the
properties for the SMTP service; the Recovery tab has options for
automatically restarting the SMTP service.

Dan
2/28/2005 3:40:37 PM
[quoted text, click to view]
Thanks. I am aware of it, but is there any specific command to do this
manually?

Jeff Henkels
3/1/2005 7:57:59 AM
[quoted text, click to view]

No, but you could do it with a couple instances of the sc command:

sc query smtpsvc -- find out if smtp is running
sc start smtpsvc -- start it if it isn't

Combine those commands and a bit of parsing code into a batch file, and
you're there. You could also write a JScript/VBScript or a Win32 console
program in VB or VC that does the same thing.

If you're not interested in verifying that the start succeeded, you could
just periodically execute "sc start smtpsvc". If the SMTP server is already
running, the command will fail, and if SMTP's stopped, it'll restart.

Dan
3/1/2005 9:16:29 AM
[quoted text, click to view]
Thank you Jeff for your help

AddThis Social Bookmark Button