共用方式為


How to View Configuration Manager Client Agent Settings

Applies To: System Center Configuration Manager 2007, System Center Configuration Manager 2007 R2, System Center Configuration Manager 2007 R3, System Center Configuration Manager 2007 SP1, System Center Configuration Manager 2007 SP2

In Microsoft System Center Configuration Manager 2007, you view the client agent settings on a Configuration Manager client by using the resource manager (UIResourceMgrClass) object GetClientAgentSettings to get a ClientAgentSettings object.

To view the Configuration Manager client agent settings

  1. Get the Configuration Manager client resource manager object (UIResourceMgrClass).

  2. From the UIResourceMgrClass object, call GetClientAgentSettings to get a Programs collection of available programs.

  3. Display the ClientAgentSettings properties.

Example

The following example method displays a list of client agent property values.

For information about calling the sample code, see How to Call Configuration Manager COM Automation Objects.

Sub ClientAgentSettings

    ' On Error Resume Next.

    Dim oUIResManager 
    Dim oAgentSettings

    Set oUIResManager = createobject("UIResource.UIResourceMgr")

    If oUIResManager Is Nothing Then
        Wscript.Echo "Couldn't create Resource Manager - quitting"
        Exit Sub
    End If

    Set oAgentSettings=oUIResManager.GetClientAgentSettings()

    If oAgentSettings Is Nothing Then
        Set oUIResManager=Nothing
        Wscript.Echo "Couldn't get software distribution information - quitting"
        Exit Sub
    End If
                                
    ' Display client agent settings.
    WScript.Echo "Day reminder interval: " & _
           FormatNumber(oAgentSettings.DayReminderInterval/60,0) + " minutes"

    WScript.StdOut.Write "Display new program notification: " 
    
    If oAgentSettings.DisplayNewProgramNotification = 0 Then
        WScript.Echo "False"
    else
        WScript.Echo "True"
    End If
        
    WScript.Echo "Hour reminder interval: " & _
    FormatNumber(oAgentSettings.HourReminderInterval/60,0) & " minutes"
    WScript.Echo "Reminder interval: " + _
    FormatNumber(oAgentSettings.ReminderInterval/60,0) + " minutes"
    WScript.Echo "Branding title: " + oAgentSettings.BrandingTitle
    WScript.Echo "Software updates branding title: " + oAgentSettings.SUMBrandingSubtitle
    WScript.Echo "Operating system deployment branding title " + oAgentSettings.OSDBrandingSubtitle
    WScript.Echo "Software distribution branding title: " + oAgentSettings.SWDBrandingSubtitle

    Set oAgentSettings=Nothing 
    Set oUIResManager=Nothing

End Sub
public void ClientAgentSettings()
{
    try
    {
            // Get client agent settings.
            UIResourceMgrClass uiResMgr = new UIRESOURCELib.UIResourceMgrClass();
            ClientAgentSettings agentSettings = uiResMgr.GetClientAgentSettings();

            // Display settings.
            Console.WriteLine("Day reminder interval: " + 
                (agentSettings.DayReminderInterval/60).ToString() + " minutes");

            Console.Write("Display new program notification: ");
            if (agentSettings.DisplayNewProgramNotification == 0)
            {
                Console.WriteLine("False");
            }
            else
            {
                Console.WriteLine("True");
            }
                            
           
            Console.WriteLine("Hour reminder interval:" + 
                (agentSettings.HourReminderInterval/60).ToString() + " minutes");
            Console.WriteLine("Reminder interval: " + 
                (agentSettings.ReminderInterval/60).ToString() + " minutes");
            Console.WriteLine("Branding title" + agentSettings.BrandingTitle);
            Console.WriteLine("Software updates branding title: " + agentSettings.SUMBrandingSubtitle);
            Console.WriteLine("Operating system deployment branding title " + agentSettings.OSDBrandingSubtitle);
            Console.WriteLine("Software distribution branding title: " + agentSettings.SWDBrandingSubtitle);
    }
    catch (COMException e)
    {
        Console.WriteLine("Error performing actions: " + e.Message);
        throw;
    }
}

The example method has no parameters.

Compiling the Code

This C# example requires:

Namespaces

System

System.Collections.Generic

System.Text

System.Runtime.InteropServices

UIRESOURCELib

COM Reference

UIResource 1.0 Type Library

Robust Programming

For more information about error handling, see About Configuration Manager Errors.

Security

For more information about securing Configuration Manager applications, see About Securing Configuration Manager Applications.

See Also

Concepts

How to Configure the Software Distribution Advertised Programs Client Agent Cache
How to Run a Program on a Configuration Manager Client
Configuration Manager Client Automation
Software Distribution Client Control Panel Automation
UIResourceMgr Class
ClientAgentSettings Class
How to Call Configuration Manager COM Automation Objects