VBS WScript List All the Properties and Methods for a WMI Class

' List All the Properties and Methods for a WMI Class


strComputer = "."
strNameSpace = "root\cimv2"
strClass = "Win32_OperatingSystem"
 
Set objClass = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ 
    strComputer & "\" & strNameSpace & ":" & strClass)
 
WScript.Echo strClass & " Class Qualifiers"
WScript.Echo "------------------------------"
i = 1
 
For Each objClassQualifier In objClass.Qualifiers_
    If VarType(objClassQualifier.Value) = (vbVariant + vbArray) Then
        strQualifier = i & ". " & objClassQualifier.Name & " = " & _
            Join(objClassQualifier.Value, ",")
    Else
        strQualifier = i & ". " & objClassQualifier.Name & " = " & _
        objClassQualifier.Value
    End If
    WScript.Echo strQualifier
    strQualifier = ""
    i = i + 1
Next
 
WScript.Echo
WScript.Echo strClass & " Class Properties and Property Qualifiers"
WScript.Echo "------------------------------------------------------"
i = 1 : j = 1
 
For Each objClassProperty In objClass.Properties_
    WScript.Echo i & ". " & objClassProperty.Name
    For Each objPropertyQualifier In objClassProperty.Qualifiers_
        If VarType(objPropertyQualifier.Value) = (vbVariant + vbArray) Then
            strQualifier = i & "." & j & ". " & _
                objPropertyQualifier.Name & " = " & _
            Join(objPropertyQualifier.Value, ",")
        Else
            strQualifier = i & "." & j & ". " & _
                objPropertyQualifier.Name & " = " & _
            objPropertyQualifier.Value
        End If
        WScript.Echo strQualifier
        strQualifier = ""
        j = j + 1
    Next
    WScript.Echo
    i = i + 1 : j = 1
Next
 
WScript.Echo
WScript.Echo strClass & " Class Methods and Method Qualifiers"
WScript.Echo "-------------------------------------------------"
i = 1 : j = 1
 
For Each objClassMethod In objClass.Methods_
    WScript.Echo i & ". " & objClassMethod.Name
    For Each objMethodQualifier In objClassMethod.Qualifiers_
        If VarType(objMethodQualifier.Value) = (vbVariant + vbArray) Then
            strQualifier = i & "." & j & ". " & _
                objMethodQualifier.Name & " = " & _
            Join(objMethodQualifier.Value, ",")
        Else
            strQualifier = i & "." & j & ". " & _
                objMethodQualifier.Name & " = " & _
                    objMethodQualifier.Value
        End If
    WScript.Echo strQualifier
    strQualifier = ""
    j = j + 1
    Next
 
    WScript.Echo
    i = i + 1 : j = 1
Next

cscript.exe //NoLogo ListWMIClass.vbs > ListWMIClass.txt

Win32_OperatingSystem Class Qualifiers
------------------------------
1. dynamic = True
2. Locale = 1033
3. provider = CIMWin32
4. Singleton = True
5. SupportsUpdate = True
6. UUID = {8502C4DE-5FBB-11D2-AAC1-006008C78BC7}

Win32_OperatingSystem Class Properties and Property Qualifiers
------------------------------------------------------
1. BootDevice
1.1. CIMTYPE = string
1.2. MappingStrings = Win32API|DRIVE_MAP_INFO|btInt13Unit
1.3. read = True

2. BuildNumber
2.1. CIMTYPE = string
2.2. MappingStrings = Win32API|System Information Structures|OSVERSIONINFOEX|dwBuildNumber
2.3. read = True

3. BuildType
3.1. CIMTYPE = string
3.2. MappingStrings = Win32Registry|Software\Microsoft\Windows\CurrentVersion|CurrentType
3.3. read = True

4. Caption
4.1. CIMTYPE = string
4.2. MaxLen = 64
4.3. read = True

5. CodeSet
5.1. CIMTYPE = string
5.2. MappingStrings = Win32API|National Language Support Functions|GetLocaleInfo|LOCALE_IDEFAULTANSICODEPAGE
5.3. MaxLen = 6
5.4. read = True

6. CountryCode
6.1. CIMTYPE = string
6.2. MappingStrings = Win32API|National Language Support Functions|GetLocaleInfo|LOCALE_ICOUNTRY
6.3. read = True

7. CreationClassName
7.1. CIM_Key = True
7.2. CIMTYPE = string
7.3. MaxLen = 256
7.4. read = True

8. CSCreationClassName
8.1. CIM_Key = True
8.2. CIMTYPE = string
8.3. MaxLen = 256
8.4. Propagated = CIM_ComputerSystem.CreationClassName
8.5. read = True

9. CSDVersion
9.1. CIMTYPE = string
9.2. MappingStrings = Win32API|System Information Structures|OSVERSIONINFOEX|szCSDVersion
9.3. read = True

10. CSName
10.1. CIM_Key = True
10.2. CIMTYPE = string
10.3. MaxLen = 256
10.4. Propagated = CIM_ComputerSystem.Name
10.5. read = True

11. CurrentTimeZone
11.1. CIMTYPE = sint16
11.2. read = True

12. DataExecutionPrevention_32BitApplications
12.1. CIMTYPE = boolean
12.2. MappingStrings = WMI
12.3. read = True

13. DataExecutionPrevention_Available
13.1. CIMTYPE = boolean
13.2. MappingStrings = WMI
13.3. read = True

14. DataExecutionPrevention_Drivers
14.1. CIMTYPE = boolean
14.2. MappingStrings = WMI
14.3. read = True

15. DataExecutionPrevention_SupportPolicy
15.1. CIMTYPE = uint8
15.2. MappingStrings = WMI
15.3. read = True
15.4. ValueMap = 0,1,2,3

16. Debug
16.1. CIMTYPE = boolean
16.2. MappingStrings = Win32API|GetSystemMetrics|SM_DEBUG
16.3. read = True

17. Description
17.1. CIMTYPE = string
17.2. MappingStrings = WMI
17.3. Override = Description
17.4. read = True
17.5. write = True

18. Distributed
18.1. CIMTYPE = boolean
18.2. read = True

19. EncryptionLevel
19.1. CIMTYPE = uint32
19.2. read = True

20. ForegroundApplicationBoost
20.1. CIMTYPE = uint8
20.2. MappingStrings = Win32Registry|SYSTEM\CurrentControlSet\Control\PriorityControl|Win32PrioritySeparation
20.3. read = True
20.4. write = True

21. FreePhysicalMemory
21.1. CIMTYPE = uint64
21.2. read = True

22. FreeSpaceInPagingFiles
22.1. CIMTYPE = uint64
22.2. MappingStrings = MIF.DMTF|System Memory Settings|001.4
22.3. read = True

23. FreeVirtualMemory
23.1. CIMTYPE = uint64
23.2. read = True

24. InstallDate
24.1. CIMTYPE = datetime
24.2. MappingStrings = MIF.DMTF|ComponentID|001.5
24.3. read = True

25. LargeSystemCache
25.1. CIMTYPE = uint32
25.2. DEPRECATED = True
25.3. read = True
25.4. ValueMap = 0,1

26. LastBootUpTime
26.1. CIMTYPE = datetime
26.2. read = True

27. LocalDateTime
27.1. CIMTYPE = datetime
27.2. MappingStrings = MIB.IETF|HOST-RESOURCES-MIB.hrSystemDate,MIF.DMTF|General Information|001.6
27.3. read = True

28. Locale
28.1. CIMTYPE = string
28.2. MappingStrings = Win32API|National Language Support Functions|GetLocaleInfo|LOCALE_ILANGUAGE
28.3. read = True

29. Manufacturer
29.1. CIMTYPE = string
29.2. MappingStrings = WMI
29.3. read = True

30. MaxNumberOfProcesses
30.1. CIMTYPE = uint32
30.2. MappingStrings = MIB.IETF|HOST-RESOURCES-MIB.hrSystemMaxProcesses
30.3. read = True

31. MaxProcessMemorySize
31.1. CIMTYPE = uint64
31.2. read = True

32. MUILanguages
32.1. CIMTYPE = string
32.2. MappingStrings = WMI
32.3. read = True

33. Name
33.1. CIMTYPE = string
33.2. read = True

34. NumberOfLicensedUsers
34.1. CIMTYPE = uint32
34.2. read = True

35. NumberOfProcesses
35.1. CIMTYPE = uint32
35.2. MappingStrings = MIB.IETF|HOST-RESOURCES-MIB.hrSystemProcesses
35.3. read = True

36. NumberOfUsers
36.1. CIMTYPE = uint32
36.2. MappingStrings = MIB.IETF|HOST-RESOURCES-MIB.hrSystemNumUsers
36.3. read = True

37. OperatingSystemSKU
37.1. CIMTYPE = uint32
37.2. MappingStrings = WMI
37.3. read = True
37.4. ValueMap = 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26

38. Organization
38.1. CIMTYPE = string
38.2. MappingStrings = Win32Registry|Software\Microsoft\Windows\CurrentVersion|RegisteredOrganization
38.3. read = True

39. OSArchitecture
39.1. CIMTYPE = string
39.2. read = True

40. OSLanguage
40.1. CIMTYPE = uint32
40.2. MappingStrings = Win32Registry|DEFAULT\Control Panel\International|Locale
40.3. read = True

41. OSProductSuite
41.1. CIMTYPE = uint32
41.2. MappingStrings = Win32Registry|SYSTEM\CurrentControlSet\Control\ProductOptions|ProductSuite
41.3. read = True

42. OSType
42.1. CIMTYPE = uint16
42.2. ModelCorrespondence = CIM_OperatingSystem.OtherTypeDescription
42.3. read = True

43. OtherTypeDescription
43.1. CIMTYPE = string
43.2. MaxLen = 64
43.3. ModelCorrespondence = CIM_OperatingSystem.OSType
43.4. read = True

44. PAEEnabled
44.1. CIMTYPE = boolean
44.2. read = True

45. PlusProductID
45.1. CIMTYPE = string
45.2. MappingStrings = Win32Registry|Software\Microsoft\Windows NT\CurrentVersion|Plus! ProductId
45.3. read = True

46. PlusVersionNumber
46.1. CIMTYPE = string
46.2. MappingStrings = Win32Registry|Software\Microsoft\Windows NT\CurrentVersion|Plus! VersionNumber
46.3. read = True

47. PortableOperatingSystem
47.1. CIMTYPE = boolean
47.2. read = True

48. Primary
48.1. CIMTYPE = boolean
48.2. MappingStrings = WMI
48.3. read = True

49. ProductType
49.1. CIMTYPE = uint32
49.2. read = True
49.3. ValueMap = 1,2,3

50. RegisteredUser
50.1. CIMTYPE = string
50.2. MappingStrings = Win32Registry|Software\Microsoft\Windows NT\CurrentVersion|RegisteredOwner
50.3. read = True

51. SerialNumber
51.1. CIMTYPE = string
51.2. MappingStrings = Win32Registry|Software\Microsoft\Windows NT\CurrentVersion|ProductId
51.3. read = True

52. ServicePackMajorVersion
52.1. CIMTYPE = uint16
52.2. MappingStrings = Win32API|System Information Structures|OSVERSIONINFOEX|wServicePackMajor
52.3. read = True

53. ServicePackMinorVersion
53.1. CIMTYPE = uint16
53.2. MappingStrings = Win32API|System Information Structures|OSVERSIONINFOEX|wServicePackMinor
53.3. read = True

54. SizeStoredInPagingFiles
54.1. CIMTYPE = uint64
54.2. MappingStrings = MIF.DMTF|System Memory Settings|001.3
54.3. read = True

55. Status
55.1. CIMTYPE = string
55.2. MaxLen = 10
55.3. read = True
55.4. ValueMap = OK,Error,Degraded,Unknown,Pred Fail,Starting,Stopping,Service,Stressed,NonRecover,No Contact,Lost Comm

56. SuiteMask
56.1. BitMap = 0,1,2,3,4,5,6,7,8,9,10
56.2. CIMTYPE = uint32
56.3. read = True

57. SystemDevice
57.1. CIMTYPE = string
57.2. MappingStrings = Win32API|Registry Functions|GetPrivateProfileString|Paths|TargetDevice
57.3. read = True

58. SystemDirectory
58.1. CIMTYPE = string
58.2. MappingStrings = Win32API|System Information Functions|GetSystemDirectory
58.3. read = True

59. SystemDrive
59.1. CIMTYPE = string
59.2. read = True

60. TotalSwapSpaceSize
60.1. CIMTYPE = uint64
60.2. read = True

61. TotalVirtualMemorySize
61.1. CIMTYPE = uint64
61.2. read = True

62. TotalVisibleMemorySize
62.1. CIMTYPE = uint64
62.2. read = True

63. Version
63.1. CIMTYPE = string
63.2. MappingStrings = Win32API|System Information Structures|OSVERSIONINFOEX|dwMajorVersion, dwMinorVersion
63.3. Override = Version
63.4. read = True

64. WindowsDirectory
64.1. CIMTYPE = string
64.2. MappingStrings = Win32API|System Information Functions|GetWindowsDirectory
64.3. read = True


Win32_OperatingSystem Class Methods and Method Qualifiers
-------------------------------------------------
1. Reboot
1.1. Implemented = True
1.2. MappingStrings = Win32API|System Shutdown Functions|ExitWindowsEx|EWX_REBOOT
1.3. Override = Reboot
1.4. Privileges = SeShutdownPrivilege
1.5. ValueMap = 0,..

2. Shutdown
2.1. Implemented = True
2.2. MappingStrings = Win32API|System Shutdown Functions|ExitWindowsEx|EWX_SHUTDOWN
2.3. Override = Shutdown
2.4. Privileges = SeShutdownPrivilege
2.5. ValueMap = 0,..

3. Win32Shutdown
3.1. Implemented = True
3.2. MappingStrings = Win32API|System Shutdown Functions|ExitWindowsEx
3.3. Privileges = SeShutdownPrivilege
3.4. ValueMap = 0,..

4. Win32ShutdownTracker
4.1. Implemented = True
4.2. MappingStrings = Win32API|System Shutdown Functions|ExitWindowsEx
4.3. Privileges = SeShutdownPrivilege
4.4. ValueMap = 0,..

5. SetDateTime
5.1. Implemented = True
5.2. Privileges = SeSystemTimePrivilege
5.3. ValueMap = 0,..

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值