SWbemPropertySet 개체

SWbemPropertySet 개체는 SWbemProperty 개체의 컬렉션입니다. Add 메서드를 사용하여 컬렉션에 항목을 추가하고 Item 메서드를 사용하여 컬렉션에서 항목을 검색하고 Remove 메서드를 사용하여 컬렉션에서 항목을 제거할 수 있습니다. 자세한 내용은 컬렉션 액세스를 참조하세요. 이 개체는 VBScript CreateObject 호출로 만들 수 없습니다.

SWbemPropertySet 컬렉션을 구성하는 SWbemProperty 개체는 단일 WMI 클래스 또는 인스턴스의 속성을 설명하는 데 사용됩니다.

멤버

SWbemPropertySet 개체에는 다음과 같은 형식의 멤버가 있습니다.

메서드

SWbemPropertySet 개체에는 다음과 같은 메서드가 있습니다.

메서드 설명
추가 SWbemPropertySet 컬렉션에 SWbemProperty 개체를 추가합니다.
항목 컬렉션에서 명명된 SWbemProperty를 가져옵니다. 이 개체의 기본 메서드입니다.
제거 컬렉션에서 SWbemProperty 개체를 삭제합니다.

속성

SWbemPropertySet 개체에는 다음과 같은 속성이 있습니다.

속성 액세스 유형 설명
개수
읽기 전용
SWbemPropertySet 컬렉션의 항목 수입니다.

예제

다음 VBScript 샘플에서는 속성이 재정의된 경우 SWbemPropertySet.RemovewbemErrResetToDefault를 반환하는 방법을 보여줍니다.

on error resume next 

'Create a keyed class with a defaulted property
set service = GetObject("Winmgmts:")
set emptyclass = service.Get
emptyclass.path_.class = "REMOVETEST00"
set prop = emptyclass.properties_.add ("p", 19)

prop.qualifiers_.add "key", true
emptyclass.properties_.add ("q", 19).Value = 12

emptyclass.put_

'create an instance and override the property
set instance = service.get ("RemoveTest00").spawninstance_

instance.properties_("q").Value = 24
instance.properties_("p").Value = 1
instance.put_

'retrieve the instance and remove the property
set instance = service.get ("removetest00=1")
set property = instance.properties_ ("q")

WScript.echo "Overridden value of property is [24]:", property.value
WScript.echo ""

instance.properties_.remove "q"
set property = instance.properties_ ("q")
WScript.echo "Value of property after removal is [12]:", property.value
WScript.echo ""

if err <> 0 then
 WScript.Echo "0x" & Hex(Err.Number), Err.Description, Err.Source
end if

요구 사항

요구 사항
지원되는 최소 클라이언트
Windows Vista
지원되는 최소 서버
Windows Server 2008
헤더
Wbemdisp.h
유형 라이브러리
Wbemdisp.tlb
DLL
Wbemdisp.dll
CLSID
CLSID_SWbemPropertySet
IID
IID_ISWbemPropertySet

추가 정보

스크립팅 API 개체