Craig,
I don't have an answer to you question, it seems like it should work. However, I do have a question about the service that sends an HTTP request to a page. I am trying to do the same thing. I have a service that runs WSH vbscripts at noon everyday. It's a generic service that will rum a any scripts in a scripts folder. That way I can add/delete scripts as needed.
Anyway the following script runs great if lanched from the desktop
Dim oHttp
Source = "http://www.mysite.com/somepage.asp?Action=Test"
Set oHttp = CreateObject("Microsoft.XMLHTTP")
oHttp.Open "GET", Source, False
oHttp.Send
Set oHttp = Nothing
The webpage called sends an e-mail to test whether e-mail service are up.
But when the service fires at noon, we don't get an e-mails.
Would you mind sharing how you perform the HTTP request within your server?
Thanks in advance.
K.E.
I have wriiten a windows service that sends an HTTP request to a page hosted on each of our Web Servers in the Web Farm (the service runs on each server). If a response is not received, I want to restart IIS on that server and send myself and email.
The service runs fine, and I get the email when IIS is not responding. However, IIS doesn't restart, and there is no error message on the line of code. The line of code I am using to restart IIS from within the Windows Service is:
Shell("iisreset " & GetHostName(), vbHide)
Running iis reset <host> through a command prompt on the server does work, so I can't make out why the service can't.