|
Home > Archive > IIS and SMTP > March 2005 > Restart SMTP automatically?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Restart SMTP automatically?
|
|
|
| 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 2005-02-28, 5:56 pm |
| "Dan" <daniel_c_hate_spam@NoSpam_myrealbox.com> wrote in message
news:u1U5XCaHFHA.560@TK2MSFTNGP12.phx.gbl...
> 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.
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.
| |
|
| "Jeff Henkels" <jeff@mapson.jeffhenkels.com> wrote in message
news:O6kAWYcHFHA.2156@TK2MSFTNGP09.phx.gbl...
> "Dan" <daniel_c_hate_spam@NoSpam_myrealbox.com> wrote in message
> news:u1U5XCaHFHA.560@TK2MSFTNGP12.phx.gbl...
>
> 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.
Thanks. I am aware of it, but is there any specific command to do this
manually?
| |
| Jeff Henkels 2005-03-01, 7:52 am |
| "Dan" <daniel_c_hate_spam@NoSpam_myrealbox.com> wrote in message
news:O7sQ6WdHFHA.2984@TK2MSFTNGP15.phx.gbl...
> "Jeff Henkels" <jeff@mapson.jeffhenkels.com> wrote in message
> news:O6kAWYcHFHA.2156@TK2MSFTNGP09.phx.gbl...
> Thanks. I am aware of it, but is there any specific command to do this
> manually?
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.
| |
|
| > 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.
>
Thank you Jeff for your help
|
|
|
|
|