SWbemObject.Properties_ property

The Properties_ property of the SWbemObject object returns an SWbemPropertySet object that is a collection of the properties for the current class or instance. This property is read-only.

For an explanation of this syntax, see Document Conventions for the Scripting API.

This property is read-only.

Syntax


SWbemObject.Properties_ As Object

Property value

Examples

The Generate Powershell WMI Class Scripts PowerShell code example on TechNet Gallery uses the Properties_ property to generate a script for each of the WMI classes that will list the WMI class name and the properties.

The following code, taken from the List All the Properties for a WMI Class VBScript code example on TechNet Gallery, Lists the properties for a specified WMI class.


strComputer = "." 
strNameSpace = "root\cimv2" 
strClass = "Win32_Service" 
  
Set objClass = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _  
    strComputer & "\" & strNameSpace & ":" & strClass) 
  
WScript.Echo strClass & " Class Properties" 
WScript.Echo "------------------------------" 
  
For Each objClassProperty In objClass.Properties_ 
    WScript.Echo objClassProperty.Name 
Next 

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Type library

Wbemdisp.tlb

DLL

Wbemdisp.dll

 

 

Show:
© 2014 Microsoft