Quantcast
Channel: Operations Manager - General forum
Viewing all articles
Browse latest Browse all 11941

Alert followed by restart services recovery - cmd v script problems

$
0
0

Hi, I am doing a test of a custom service failure/restart in which if one service fails 3 services also need to berestarted one after each other.

To do my test I am just stopping the wireless configuration service (WZCSVC) and have a monitor that watches (and works) for when this has stopped.

I then want my diagnostic and recovery task to start the 3 services. I did "Run Script" and gave it a "file name" of "startservices.cmd" (without the ""), set the timeout to a 2 minutes and just pasted in the following (the delay is because I wasnt sure if a pause was needed) -

rem ** test of starting 3 services **
net start wzcsvc

rem the choice below is used for a pause
choice /C:AB /T:20 /D:A >NUL
net start alg

choice /C:AB /T:20 /D:A >NUL
net start appmgmt

This does not fix the problem. When I look at health explorer the recovery output seems to indicate the command executed is trying to run c:\windows\system32\cscript.exe and then my "startservices.cmd". So reading this can you only use cscript in the "script"? Can you use powershell even?


However if I save the commands as a file on the actual remote server I can use a command line recovery of -
c:\windows\system32\cmd.exe
/c c:\scripts\startservices.cmd

and it does work.

I would prefer that I dont have to save my scripts to multiple remote servers. Is my logic wrong here. Is the script version running against the SCOM server rather than the remote server or something or is it simply I have to useVBScript??

many thanks


Viewing all articles
Browse latest Browse all 11941

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>