Overrides adjust the configuration of Operations Manager monitoring settings for monitors, attributes, object discoveries, and rules. You can query for overrides by defining criteria in the Microsoft.EnterpriseManagement.Configuration.MonitoringOverrideCriteria class constructor. The criteria syntax is defined in Criteria Expression Syntax. The following property names are valid names that can be used in the criteria expression:

The following code queries for all the overrides that are enforced.

C#  Copy Code
/// <summary> 
/// Query for overrides.
/// </summary>
using System;
using System.Collections.ObjectModel;
using Microsoft.EnterpriseManagement;
using Microsoft.EnterpriseManagement.Configuration;
using Microsoft.EnterpriseManagement.Monitoring;

namespace SDKSamples
	class Program
		static void Main(string[] args)
			ManagementGroup mg = new ManagementGroup("localhost");

			// The criteria specifies that you want to collect
			// all the overrides that are enforced.
			MonitoringOverrideCriteria overrideCriteria =
				new MonitoringOverrideCriteria(
				"Enforced = 1");

			Console.WriteLine("Querying for data...");
			ReadOnlyCollection<ManagementPackOverride> overrides =

			// Display information about each override.
			foreach (ManagementPackOverride mpOverride in overrides)
				Console.WriteLine("Override name: " + mpOverride.Name);
				Console.WriteLine("Status: " + mpOverride.Status);
				Console.WriteLine("Context: " + mpOverride.Context.Name);
				Console.WriteLine("Description: " + mpOverride.Description +

Send comments about this topic to Microsoft.