OutParameters 개체 구문 분석

SWbemMethod.OutParameters 개체가 만들어지고 실행 중인 공급자 메서드에 의해 데이터가 제공됩니다. OutParameters 개체의 속성은 호출된 메서드와 관련이 있습니다. 예를 들어, 아래 스크립트에서 SD(outParam에 포함됨)는 __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를 참조하세요.