Share via


MSReportServer_ConfigurationSettingForSharePoint クラス

新規 : 2006 年 12 月 12 日

SharePoint 統合モード用に構成されたレポート サーバー インスタンスのインストール パラメータとランタイム パラメータを表します。これらのパラメータはレポート サーバーの構成ファイルに格納されています。

このクラスのすべてのメンバの一覧については、「MSReportServer_ConfigurationSettingForSharePoint メンバ」を参照してください。

構文

Public Class MSReportServer_ConfigurationSettingForSharePoint
public class MSReportServer_ConfigurationSettingForSharePoint

スレッドセーフ

この型の public static (Visual Basic では Shared) のすべてのメンバは、マルチスレッド操作で安全に使用できます。インスタンスのメンバは、スレッドセーフであるとは限りません。

使用例

このコードを実行するには、<servername> を実際のサーバー名に置き換えます。インストールの場所が既定でない場合は、その場所を指すようにパスを指定します。次のコード例は、MSReportServer_ConfigurationSettingForSharePoint クラスの各プロパティを反復処理し、各プロパティの名前とその値をコンソールに出力します。

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();
    }
}

要件

名前空間 :root\Microsoft\SqlServer\ReportingServices\v9\Admin

プラットフォーム : Windows Server 2003 Datacenter Edition、Windows Server 2003 Enterprise Edition、Windows Server 2003 Standard Edition、Windows Vista、Windows XP Professional Service Pack 2 (SP2) または Service Pack 1 (SP1)、および Windows 2000 (すべてのバージョン)

参照

関連項目

MSReportServer_ConfigurationSettingForSharePoint メンバ

ヘルプおよび情報

SQL Server 2005 の参考資料の入手