Windows Management Instrumentation (WMI) インフラストラクチャの重要なコンポーネントは、システム内の管理可能なエンティティのオブジェクト指向モデルです。 このモデルは、デスクトップ管理タスク フォース (DMTF) によって管理されている標準に準拠し、共通情報モデル (CIM) と呼ばれます。 CIM_DataFile や Win32_Processなど、モデル内の一部のクラスは、管理可能なエンティティに直接対応します。 モデル内の他のクラス (Win32_SystemServicesなど) は、管理可能なエンティティ間のリレーションシップを表します。 これらのリレーションシップ モデリング クラスは、アソシエーション クラスと呼ばれます。
WMI 固有のクエリ言語 WQL を使用すると、管理可能なエンティティまたは Association クラスのインスタンスを表すクラスのインスタンスを取得できます。 ただし、WQL は実装固有です。 DMTF 標準 (WMI) の Windows 実装でのみ機能します。 さらに、Association クラスを取得するための WQL 構文はかなり複雑です。
Windows リモート管理 (WinRM) インフラストラクチャは、WMI の機能を活用する優れた方法を提供します。 初期バージョンの WinRM では、WQL を使用して Association クラスのインスタンスを取得する必要がありました。 WinRM 2.0 には、アソシエーション トラバーサルによる DMTF プロファイル検出と呼ばれる新機能が含まれています。 アソシエーション トラバーサルを使用すると、WinRM のユーザーは、DMTF CIM バインド仕様で定義されている標準のフィルター処理メカニズムである AssociationFilter 方言を使用して、Association クラスのインスタンスを取得できます。 アソシエーション トラバーサルの詳細については、WS-Management CIM バインディングの仕様 (Web サービス管理) を参照してください。
winrm ユーティリティは、適切な関連付けを走査し、デバイス プロファイルを取得する簡単なメカニズムを提供します。
構成実装の詳細
winrm ユーティリティで、関連付け要求の方言がサポートされるようになりました。 URI またはエイリアスは、winrm ユーティリティを使用して指定できます。
別名 | URI |
---|---|
協会 | https://www.dmtf.org/sites/default/files/standards/documents/DSP0227_1.0.0.pdf |
AssociationFilter 言語を使用した Association クラスのインスタンスの取得
winrm ユーティリティは、特定のソース インスタンスの WMI アソシエーション クラス インスタンスを取得できます。 次のコマンドは、winrm ユーティリティを使用して、Win32_Service 関連付けクラスのインスタンスを取得する方法を示しています。 アソシエーション クラスを返すには、スイッチ "-associations" を使用する必要があります。
winrm enumerate wmicimv2/* -dialect:association -associations -filter:{object=win32_service?name=winrm;resultclassname=win32_dependentservice;role=dependent}
次のテキスト ベースのスニペットは、上記のコマンドの出力です。
Win32_DependentService
Antecedent
Address = https://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
ReferenceParameters
ResourceURI = http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service
SelectorSet
Selector: Name = RpcSs
Dependent
Address = https://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
ReferenceParameters
ResourceURI = http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service
SelectorSet
Selector: Name = WinRM
TypeOfDependency = null
Win32_DependentService
Antecedent
Address = https://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
ReferenceParameters
ResourceURI = http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_SystemDriver
SelectorSet
Selector: Name = HTTP
Dependent
Address = https://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
ReferenceParameters
ResourceURI = http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service
SelectorSet
Selector: Name = WinRM
TypeOfDependency = null
AssociationFilter 言語を使用して関連付けられたクラスのインスタンスを取得する
winrm ユーティリティは、特定のソース インスタンスに関連付けられている WMI クラス インスタンスを取得できます。 次のコマンドは、winrm ユーティリティを使用して、関連付けられているクラスのインスタンス Win32_Service 取得する方法を示しています。
winrm enumerate wmicimv2/* -dialect:association -filter:{object=win32_service?name=winrm;associationclassname=win32_dependentservice;resultclassname=win32_service;resultrole=antecedent;role=dependent}
次のテキスト ベースのスニペットは、上記のコマンドの出力です。
Win32_Service
AcceptPause = false
AcceptStop = false
Caption = Remote Procedure Call (RPC)
CheckPoint = 0
CreationClassName = Win32_Service
Description = The RPCSS service is the Service Control Manager for COM and DCOM servers. It performs object activations requests, object exporter resolutions and distributed garbage collection for COM and DCOM servers. If this service is stopped or disabled, programs using COM or DCOM will not function properly. It is strongly recommended that you have the RPCSS service running DesktopInteract = false
DisplayName = Remote Procedure Call (RPC)
ErrorControl = Normal
ExitCode = 0
InstallDate = null
Name = RpcSs
PathName = C:\Windows\system32\svchost.exe -k rpcss
ProcessId = 716
ServiceSpecificExitCode = 0
ServiceType = Share Process
Started = true
StartMode = Auto
StartName = NT AUTHORITY\NetworkService
State = Running
Status = OK
SystemCreationClassName = Win32_ComputerSystem
SystemName = myComputer
TagId = 0
WaitHint = 0