分析 OutParameters 对象

SWbemMethod.OutParameters 对象由正在执行的提供程序方法创建并提供数据。 OutParameters 对象的属性特定于所调用的方法。 例如在下面的脚本中,outParam 中包含的 SD 是为 __SystemSecurity.GetSD 方法定义的输出参数。 ReturnValue 属性是一个通用属性,可用于所有包含操作结果的 OutParameters 对象。

以下代码示例演示如何从本地系统的 __SystemSecurity 类中执行 GetSD 方法来获取输出参数。

' 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