Link to home
Start Free TrialLog in
Avatar of introlux
introluxFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Auto Start Virtual SMTP - Windows Server 2008 R2

Hi,

We are experiencing issues where Virtual SMTP stop, I am aware of the following scripts to start and stop the service:

To Start:

$SMTP=[adsi]"IIS://localhost/SMTPSVC/1"
$SMTP.ServerState = 2
$SMTP.SetInfo()

To Stop:

$SMTP=[adsi]"IIS://localhost/SMTPSVC/1"
$SMTP.ServerState = 4
$SMTP.SetInfo()

Any idea how I can put this in a script to check the service is in a stop state (4) and if so to start it and it into state 2.

Regards,

introlux
ASKER CERTIFIED SOLUTION
Avatar of OriNetworks
OriNetworks

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Are there any errors in the event logs?

Also, if you look into the IIS SMTP logs (you have logging enabled, right?), is there any event that occurs right before the SMTP site goes offline?

Dan