다음을 통해 공유


How to Create a Dashboard

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

You create a custom dashboard, in Microsoft System Center Configuration Manager 2007, by creating an instance of the SMS_ReportDashboard class and populating the properties.

To create a dashboard

  1. Set up a connection to the SMS Provider.

  2. Create the new dashboard using the SMS_ReportDashboard class.

  3. Populate the new dashboard properties.

  4. Save the new dashboard and properties.

Example

The following example method shows how to create a custom dashboard by creating an instance of the SMS_ReportDashboard class and populating the properties.

For information about calling the sample code, see Calling Configuration Manager Code Snippets.

Sub CreateDashboard(connection,           _
                    newDashboardName,     _
                    newColumnCount,       _
                    newRowVerticalLimit)

    ' Create the new dashboard object.
    Set newDashboard = connection.Get("SMS_ReportDashboard").SpawnInstance_
    
    ' Populate the new dashboard properties.
    newDashboard.Name = newDashboardName
    newDashboard.ColumnCount = newColumnCount
    newDashboard.RowVerticalLimit =  newRowVerticalLimit
            
    ' Save the new dashboard and properties.
    newDashboard.Put_ 
    
    ' Output the dashboard name.
    Wscript.Echo "Created new dashboard: " & newDashboardName                  
                                    
End Sub
public void CreateDashboard(WqlConnectionManager connection,
                            string newDashboardName,
                            string newColumnCount,
                            string newRowVerticalLimit)
{
    try
    {
        // Create new dashboard object.
        IResultObject newDashboard = connection.CreateInstance("SMS_ReportDashboard");

        // Populate new dashboard properties.
        newDashboard["Name"].StringValue = newDashboardName;
        newDashboard["ColumnCount"].StringValue = newColumnCount;
        newDashboard["RowVerticalLimit"].StringValue = newRowVerticalLimit;

        // Save the new dashboard and new dashboard properties.
        newDashboard.Put();

        // Output the new dashboard name.
        Console.WriteLine("Created dashboard: " + newDashboardName);
    }
    catch (SmsException ex)
    {
        Console.WriteLine("Failed to create dashboard. Error: " + ex.Message);
        throw;
    }
}

The example method has the following parameters:

Parameter

Type

Description

Connection

  • Managed: WqlConnectionManager

  • VBScript: SWbemServices

A valid connection to the SMS Provider.

newDashboardName

  • Managed: String

  • VBScript: String

A string indicating the name of the new dashboard.

newColumnCount

  • Managed: Integer

  • VBScript: Integer

The number of reports tiled horizontally across the dashboard.

newRowVerticalLimit

  • Managed: Integer

  • VBScript: Integer

Vertical height, in pixels, of a tiled dashboard row. Set this property to null if there is no limit.

Compiling the Code

This C# example requires:

Namespaces

System

System.Collections.Generic

System.Text

Microsoft.ConfigurationManagement.ManagementProvider

Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine

Assembly

adminui.wqlqueryengine

microsoft.configurationmanagement.managementprovider

Robust Programming

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

Security

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

See Also

Concepts

System Center Configuration Manager Software Development Kit
Configuration Manager Reporting
SMS_ReportDashboard Server WMI Class