ActiveXperts Knowledge Base Article 7620025

Q7620025 - I want to restart services after failure, but I want to do this dynamically, i.e. at runtime will be decided which services to start. How can I achieve this?

It is pretty easy: just write a small VBScript program and launch it when the check fails. You can use the following script as a base for your own script:

strRemoteComputer = "server05"
strService = "alerter"
For each Service in GetObject("winmgmts:{impersonationLevel=impersonate}!//" & strRemoteComputer)_
    .ExecQuery("select * from Win32_Service where Name='" & strService & "'")
    Service.StartService
Next

Contact Support

If you cannot find an answer to your question(s) in our Knowledge Base, or if you need additional information or assistance, please contact our Customer Support using the Contact Support form:
Contact Support »

M