Export (0) Print
Expand All

How to Configure Management Group Properties

System Center

Updated: May 22, 2009

Applies To: Operations Manager 2007 R2, Operations Manager 2007 SP1, System Center Operations Manager 2007

The Operations Manager class libraries allow you to query and change many of the default Management Group settings.

Example

The following example demonstrates how to display the default heartbeat interval for all agent-managed computers in the Management Group. The example then changes the default interval to a new value.

/// <summary>
/// Displays the current default agent heartbeat interval,
/// and then changes the interval to 50 seconds.
/// </summary>
using System;
using System.Collections.Generic;
using Microsoft.EnterpriseManagement;
using Microsoft.EnterpriseManagement.Administration;
using System.Text;

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

            Console.WriteLine("Configuring Management Group properties...");
            
            ManagementGroupAdministration mga = mg.GetAdministration();
                        
            Console.WriteLine("The heartbeat interval is currently: "
+ mga.Settings.GetDefaultValue(Settings.Agent.Heartbeats.Interval));

            mga.Settings.SetDefaultValue<int>(Settings.Agent.Heartbeats.Interval,
                50);
            
            // need to call ApplyChanges to save the changes.
            //mga.Settings.ApplyChanges();

            Console.WriteLine("Agent heartbeat interval has now been set to: " +
                mga.Settings.GetDefaultValue(Settings.Agent.Heartbeats.Interval));            
        }
    }
}

See Also

Show:
© 2014 Microsoft