SystemCenter

All about System Center Articles and Tutorials

Reset SCOM Unit Monitors in Bulk

Posted by on Aug 23, 2016 in PowerShell, SCOM 2012

Reset SCOM Unit Monitors in Bulk

Recently someone asked me if there’s any possibility to reset all the Unit Monitors in Bulk as resetting the individual monitors that don’t recalculate automatically is really a tedious task.

I checked few of the unhealthy servers in their SCOM environment and found there were monitors sitting in unhealthy state and there was not any open alert corresponding to those unhealthy monitors in the SCOM console.

If the alert gets cleared for any reason, unhealthy monitors can be found using State Views and Health Explorer.

1

There are two ways through which we can reset all the Unit Monitors in one go, starting with the easiest one:

1: Putting all Servers in Maintenance Mode

You can select the servers (except the Management Server) and put them under Maintenance Mode for 10 minutes.

2

After 10 minutes when the servers will be out from Maintenance Mode, the Monitors should reset and you should see Healthy state of all those servers.

 

3

2: PowerShell Script.

If you don’t want to put your servers under Maintenance Mode for resetting the Monitors, PowerShell can help you in resetting the same.

There’s a blog written by Predrag Oparnica available at Microsoft TechNet site wherein he has provided the PowerShell script initially written by scomurr which can reset all the Unit Monitors and it works similar to the GreenMachine Utility for SCOM 2007.

The script can be downloaded from here: OpsMgr2012.MonitorReset.ps1

Running the script:

1: Download the file and copy same under C: drive on Management Server.

2: Rename the file from OpsMgr2012.MonitorReset.ps1.txt to OpsMgr2012.MonitorReset.ps1

Syntax: OpsMgr2012.MonitorReset.ps1 -sdkserver <SDKSERVER> -action <REPORT\EXECUTE>

Example:

Parameter: REPORT

Open PowerShell as Administrator on SCOM Management Server and execute below command:

.\OpsMgr2012.MonitorReset.ps1 -sdkserver SCMVPSCOMMS1.TEST.COM -action REPORT

4

REPORT parameter will generate a report file (ResetReport.TXT) under C:\Windows\Temp folder  displaying Health State of the objects.

5

Parameter: EXECUTE

The EXECUTE parameter will reset all Monitors in an UnSuccess healthstate.

Open PowerShell as Administrator on SCOM Management Server and execute below command:

.\OpsMgr2012.MonitorReset.ps1 -sdkserver SCMVPSCOMMS1.TEST.COM -action EXECUTE

6

The script may take several minutes to complete, based upon your SCOM environment.

Once the query completes, you should get healthy status of your servers. Green is Good!!!

7

Disclaimer: This posting is provided “AS IS” with no warranties, and confers no rights. It’s advised to verify the script in your test environment before running in production system.

1 Comment

  1. Get-SCOMClassInstance : The query processor ran out of internal resources and could not produce a query plan. This is a rare event and only expected for extremely complex queries or queries that reference a very large number of tables or partitions. Please simplify the
    query. If you believe you have received this message in error, contact Customer Support Services for more information.

    I have 200 servers.

Submit a Comment

Your email address will not be published. Required fields are marked *