Restart a service and all antecedent from a Task in OpsMgr

Now its time to use a vbs script to ensure that all services are stopped and started in the correct way – so if any services are dependent on other they will be restated as well.

First Create a new task from your Console:

image

Let it be an Agent Tasks and Remember the Management Pack:

image

Give it a Name and a Target like this:

image

image

Add a Parameter – either your Service shortname or a text like this:

Press [OK] and [Create].

image

Choose a server and [Restart a Services and its dependencies]

image

When running te task you need to create a override for the service which should be restarted:

image

As a test we use the Workstation service – this service have other services which is depenent on it.

image

And Run IT

image

And the result – all services which is dependent on Workstation services and the Workstation Services itselft have been restarted.

image

 

And the Script to paste in your Task:

By | 2011-04-12T21:37:00+00:00 April 12th, 2011|Operations Manager (SCOM)|1 Comment

About the Author:

Kåre Rude Andersen
Microsoft Certified Trainer since 1996, MCSE, TS and ITP in Microsoft Windows, SQL (also Microsoft), Exchange (MS) and Microsoft Operations Manager. Senior Consultant and have recently worked as a consultant at CSC, SAS, ISS, Nokia and Scandlines.

One Comment

  1. Adam May 2, 2012 at 19:27 - Reply

    Hi Kåre,
    Great Script! Is it possible to add output (view Task Status)? This way it would log what service(s) was restarted. Would there be any problems if I setup more than one of task? I’m thinking about hard-coding specific services to be restarted without having to do an override.

Leave A Comment