次の方法で共有


ServerGroups Collection

この機能は、将来のバージョンの Microsoft SQL Server では削除される予定です。新しい開発作業では、この機能の使用を避け、現在この機能を使用しているアプリケーションは修正するようにしてください。

The ServerGroups collection contains ServerGroup objects that expose a classification system for the registry-maintained list of instances of Microsoft SQL Server.

現在のオブジェクトを表す SQL-DMO オブジェクト モデル

Properties

説明

SQL Distributed Management Objects (SQL-DMO) applications can maintain lists of some or all instances of SQL Server in an organization. The lists are stored in the Windows registry.

Each registry-maintained list is visible in a SQL-DMO application through the RegisteredServers collection. A ServerGroup object classifies a list, providing a meaningful name for a list of instances of SQL Server.

With the ServerGroups collection, you can:

  • Create a category used to classify a registry-maintained list of instances of SQL Server.

  • Remove a category classifying registry-maintained lists of instances of SQL Server.

To create a classification for registry-maintained lists of instances of SQL Server

  1. Create a ServerGroup object.

  2. Set the Name property of the ServerGroup object.

  3. Add the ServerGroup object to the ServerGroups collection of the Application object.

To remove an organization server classification

  1. Get the ServerGroup object referencing the target classification from the ServerGroups collection of the Application object.

  2. Use the Remove method of the RegisteredServers collection of the target ServerGroup object to remove any instances maintained under the classification.

  3. Use the Remove method of the ServerGroup object to remove the classification.

    重要な注意事項重要

    When using the ServerGroups collection to remove an existing registry-maintained classification, the RegisteredServers collection of the target ServerGroup object must be empty.

When using the Item or Remove method, the ServerGroups collection supports member identification using either name or ordinal reference syntax. For example:

Set oServerGroup = oApplication.ServerGroups("London")

Or:

Set oServerGroup = oApplication.ServerGroups(1)