Поделиться через


MSReportServer_ConfigurationSettingForSharePoint Class

Добавления: 12 декабря 2006 г.

Represents the installation and run-time parameters of a report server instance that is configured for SharePoint integrated mode. These parameters are stored in the configuration file for the report server.

For a list of all members of this type, see MSReportServer_ConfigurationSettingForSharePoint Members.

Syntax

Public Class MSReportServer_ConfigurationSettingForSharePoint
public class MSReportServer_ConfigurationSettingForSharePoint

Thread Safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread-safe.

Пример

To run the following code, add your server name in place of each <servername>. Correct the path to point to your installation location, if not the default. The following code example iterates through each property in the MSReportServer_ConfigurationSettingForSharePoint Class, printing the name of each property and its value to the console.

Imports System
Imports System.Management
Imports System.IO

Module Module1
    Sub Main()
        Const WmiNamespace As String = "\\<servername>\root\Microsoft\SqlServer\ReportServer\v9\Admin"
        Const WmiRSClass As String = _
           "\\<servername>\root\Microsoft\SqlServer\ReportServer\v9\Admin:MSReportServer_ConfigurationSettingForSharePoint "

        Dim serverClass As ManagementClass
        Dim scope As ManagementScope
        scope = New ManagementScope(WmiNamespace)
        'Connect to the Reporting Services namespace.
        scope.Connect()

        'Create the server class.
        serverClass = New ManagementClass(WmiRSClass)
        'Connect to the management object.
        serverClass.Get()
        If serverClass Is Nothing Then Throw New Exception("No class found")

        'Loop through the instances of the server class.
        Dim instances As ManagementObjectCollection = serverClass.GetInstances()
        Dim instance As ManagementObject
        For Each instance In instances
            Console.Out.WriteLine("Instance Detected")
            Dim instProps As PropertyDataCollection = instance.Properties
            Dim prop As PropertyData
            For Each prop In instProps
                Dim name As String = prop.Name
                Dim val As Object = prop.Value
                Console.Out.Write("Property Name: " + name)
                If val Is Nothing Then
                    Console.Out.WriteLine("     Value: <null>")
                Else
                    Console.Out.WriteLine("     Value: " + val.ToString())
                End If
            Next
        Next

        Console.WriteLine("--- Press any key ---")
        Console.ReadKey()


    End Sub
End Module
using System;
using System.Management;
using System.IO;
[assembly: CLSCompliant(true)]

class Class1
{
    [STAThread]
    static void Main(string[] args)
    {
        const string WmiNamespace = @"\\<servername>\root\Microsoft\SqlServer\ReportServer\v9\Admin";
        const string WmiRSClass =
          @"\\<servername>\root\Microsoft\SqlServer\ReportServer\v9\Admin:MSReportServer_ConfigurationSettingForSharePoint";
        ManagementClass serverClass;
        ManagementScope scope;
        scope = new ManagementScope(WmiNamespace);

        // Connect to the Reporting Services namespace.
        scope.Connect();
        // Create the server class.
        serverClass = new ManagementClass(WmiRSClass);
        // Connect to the management object.
        serverClass.Get();
        if (serverClass == null)
            throw new Exception("No class found");

        // Loop through the instances of the server class.
        ManagementObjectCollection instances = serverClass.GetInstances();

        foreach (ManagementObject instance in instances)
        {
            Console.Out.WriteLine("Instance Detected");
            PropertyDataCollection instProps = instance.Properties;
            foreach (PropertyData prop in instProps)
            {
                string name = prop.Name;
                object val = prop.Value;
                Console.Out.Write("Property Name: " + name);
                if (val != null)
                    Console.Out.WriteLine("     Value: " + val.ToString());
                else
                    Console.Out.WriteLine("     Value: <null>");
            }
        }
        Console.WriteLine("\n--- Press any key ---");
        Console.ReadKey();
    }
}

Requirements

Namespace:root\Microsoft\SqlServer\ReportingServices\v9\Admin

Platform: Windows Server 2003 Datacenter Edition; Windows Server 2003 Enterprise Edition; Windows Server 2003 Standard Edition; Windows Vista; Windows XP Professional с пакетом обновления 2 (SP2) или 1 (SP1) или Windows 2000 (все версии)

См. также

Справочник

MSReportServer_ConfigurationSettingForSharePoint Members

Справка и поддержка

Получение помощи по SQL Server 2005