OutParameters オブジェクトの解析

実行中のプロバイダー メソッドによって、SWbemMethod.OutParameters オブジェクトが作成され、データが提供されます。 OutParameters オブジェクトのプロパティは、呼び出されたメソッドに固有です。 たとえば、次のスクリプトの SD (outParam に含まれる) は、__SystemSecurity.GetSD メソッドに対して定義された出力パラメータです。 ReturnValue プロパティは、操作の結果を含むすべての OutParameters オブジェクトで使用できる汎用プロパティです。

次のコード例は、ローカル システムのクラス __SystemSecurityGetSD メソッドを実行して出力パラメータを取得する方法を示しています。

' Connect to WMI root\cimv2 namespace.
Set svc = GetObject("winmgmts:root/cimv2")
' Execute the GetSD method and obtain the output parameters.
set outParam = svc.Execmethod("__SystemSecurity=@", "GetSD")
wscript.echo outparam.ReturnValue
' Format the security descriptor array
' in the SD parameter into one string to display.
objSD  = Join(outparam.SD,",")
wscript.echo objSD
' Release the out parameters object.
set outParam = nothing

詳細については、SWbemMethod.InParameters に関する記事を参照してください。