Thursday 5 July 2012

SCOM 2007: Set up a recovery task for a process running under specific credentials

If you have a process running under a specific service account, and you want to monitor it and automate a recovery action in case it crashes, here is an easy way to do it without exposing the credentials.

Find out how to get the process up and running directly from Windows (e.g. by running an exe file or a script) and create a scheduled task for it, without actually scheduling it. Set the task to run under the proper credentials and select ‘Run whether user is logged on or not’.

In SCOM, configure monitoring of the process and set up a recovery task in the monitor’s properties. Use the tool ‘schtasks.exe’ to run the task created earlier.

Set these under the Command Line tab:

Full path to file:
C:\Windows\System32\schtasks.exe

Parameters:
/run /s servername /tn taskname

Note: This won't work for every application (e.g. IPFX telephony application). You need to test it by manually terminating a process and confirming that the task is able to recover it. Also, make sure to check the application and process behaviour following a server reboot.

1 comment:

  1. Great post! This is EXACTLY what I was looking for!

    ReplyDelete