PowerOnHours - property in ROOT\virtualization\v2 namespace

PowerOnHours in other namespaces

List of classes with PowerOnHours local property in ROOT\virtualization\v2 namespace

propertyClassOrigin
PowerOnHoursCIM_LogicalDeviceCIM_LogicalDevice

List of classes with PowerOnHours derived property in ROOT\virtualization\v2 namespace

propertyClassOrigin
PowerOnHoursCIM_CDROMDriveCIM_LogicalDevice
PowerOnHoursCIM_ControllerCIM_LogicalDevice
PowerOnHoursCIM_DesktopMonitorCIM_LogicalDevice
PowerOnHoursCIM_DiskDriveCIM_LogicalDevice
PowerOnHoursCIM_DisketteDriveCIM_LogicalDevice
PowerOnHoursCIM_DisplayCIM_LogicalDevice
PowerOnHoursCIM_DisplayControllerCIM_LogicalDevice
PowerOnHoursCIM_DVDDriveCIM_LogicalDevice
PowerOnHoursCIM_EthernetPortCIM_LogicalDevice
PowerOnHoursCIM_FCPortCIM_LogicalDevice
PowerOnHoursCIM_IDEControllerCIM_LogicalDevice
PowerOnHoursCIM_LogicalDiskCIM_LogicalDevice
PowerOnHoursCIM_LogicalPortCIM_LogicalDevice
PowerOnHoursCIM_MediaAccessDeviceCIM_LogicalDevice
PowerOnHoursCIM_MemoryCIM_LogicalDevice
PowerOnHoursCIM_NetworkPortCIM_LogicalDevice
PowerOnHoursCIM_PointingDeviceCIM_LogicalDevice
PowerOnHoursCIM_ProcessorCIM_LogicalDevice
PowerOnHoursCIM_ProtocolControllerCIM_LogicalDevice
PowerOnHoursCIM_SCSIProtocolControllerCIM_LogicalDevice
PowerOnHoursCIM_SerialControllerCIM_LogicalDevice
PowerOnHoursCIM_StorageExtentCIM_LogicalDevice
PowerOnHoursCIM_TapeDriveCIM_LogicalDevice
PowerOnHoursCIM_USBDeviceCIM_LogicalDevice
PowerOnHoursCIM_UserDeviceCIM_LogicalDevice
PowerOnHoursCIM_VideoHeadCIM_LogicalDevice
PowerOnHoursCIM_WiFiPortCIM_LogicalDevice
PowerOnHoursMsvm_DiskDriveCIM_LogicalDevice
PowerOnHoursMsvm_DisketteControllerCIM_LogicalDevice
PowerOnHoursMsvm_DisketteDriveCIM_LogicalDevice
PowerOnHoursMsvm_DVDDriveCIM_LogicalDevice
PowerOnHoursMsvm_EmulatedEthernetPortCIM_LogicalDevice
PowerOnHoursMsvm_EthernetSwitchPortCIM_LogicalDevice
PowerOnHoursMsvm_ExternalEthernetPortCIM_LogicalDevice
PowerOnHoursMsvm_ExternalFcPortCIM_LogicalDevice
PowerOnHoursMsvm_FcSwitchPortCIM_LogicalDevice
PowerOnHoursMsvm_GuestServiceInterfaceComponentCIM_LogicalDevice
PowerOnHoursMsvm_HeartbeatComponentCIM_LogicalDevice
PowerOnHoursMsvm_IDEControllerCIM_LogicalDevice
PowerOnHoursMsvm_InternalEthernetPortCIM_LogicalDevice
PowerOnHoursMsvm_KeyboardCIM_LogicalDevice
PowerOnHoursMsvm_KvpExchangeComponentCIM_LogicalDevice
PowerOnHoursMsvm_LogicalDiskCIM_LogicalDevice
PowerOnHoursMsvm_MemoryCIM_LogicalDevice
PowerOnHoursMsvm_Physical3dGraphicsProcessorCIM_LogicalDevice
PowerOnHoursMsvm_ProcessorCIM_LogicalDevice
PowerOnHoursMsvm_Ps2MouseCIM_LogicalDevice
PowerOnHoursMsvm_RdvComponentCIM_LogicalDevice
PowerOnHoursMsvm_S3DisplayControllerCIM_LogicalDevice
PowerOnHoursMsvm_SCSIProtocolControllerCIM_LogicalDevice
PowerOnHoursMsvm_SerialControllerCIM_LogicalDevice
PowerOnHoursMsvm_SerialPortCIM_LogicalDevice
PowerOnHoursMsvm_ShutdownComponentCIM_LogicalDevice
PowerOnHoursMsvm_Synthetic3DDisplayControllerCIM_LogicalDevice
PowerOnHoursMsvm_SyntheticDisplayControllerCIM_LogicalDevice
PowerOnHoursMsvm_SyntheticEthernetPortCIM_LogicalDevice
PowerOnHoursMsvm_SyntheticFcPortCIM_LogicalDevice
PowerOnHoursMsvm_SyntheticMouseCIM_LogicalDevice
PowerOnHoursMsvm_TimeSyncComponentCIM_LogicalDevice
PowerOnHoursMsvm_VideoHeadCIM_LogicalDevice
PowerOnHoursMsvm_VssComponentCIM_LogicalDevice
PowerOnHoursMsvm_WiFiPortCIM_LogicalDevice

Code samples for PowerOnHours property

Get instance of WMI class using GetObject, PowerOnHours property of Msvm_Processor

Short VBS code - get a single specified instance of Msvm_Processor class or get a default unnamed instance (singleton) of the class, using one single command GetObject with exact path of the wmi object.

'https://wutils.com/wmi/
Dim wmiObject
Set wmiObject = GetObject( _
 "WINMGMTS:\\.\ROOT\virtualization\v2:" + _
 "Msvm_Processor.CreationClassName=""Msvm_Processor"",DeviceID=""Microsoft:B637F347-6A0E-4DEC-AF52-BD70CB80A21D\\0\\0"",SystemCreationClassName=""Msvm_ComputerSystem"",SystemName="".""")
Wscript.Echo wmiObject.PowerOnHours 'or other property name, see properties
See more VBS samples of Msvm_Processor class

WMI query - sample windows WQL with C#, PowerOnHours property of Msvm_Processor

Get a specified instance of Msvm_Processor by a key, get a default unnamed instance (singleton) of the class or list instances of the class by wmi query using this c# sample code.
See in another language: VBScript, VB.Net.
//https://wutils.com/wmi/

//Project -> Add reference -> System.Management
//using System.Management;

//create a management scope object
ManagementScope scope = new ManagementScope("\\\\.\\ROOT\\virtualization\\v2");

//create object query
ObjectQuery query = new ObjectQuery("SELECT * FROM Msvm_Processor Where CreationClassName=\"Msvm_Processor\"DeviceID=\"Microsoft:B637F347-6A0E-4DEC-AF52-BD70CB80A21D\\\\0\\\\0\"SystemCreationClassName=\"Msvm_ComputerSystem\"SystemName=\"W2012SDC\"");

//create object searcher
ManagementObjectSearcher searcher =
                        new ManagementObjectSearcher(scope, query);

//get a collection of WMI objects
ManagementObjectCollection queryCollection = searcher.Get();

//enumerate the collection.
foreach (ManagementObject m in queryCollection) 
{
  // access properties of the WMI object
  Console.WriteLine("PowerOnHours : {0}", m["PowerOnHours"]);
  
}

WMI query - sample windows WQL with VB.Net, PowerOnHours property of Msvm_Processor

Get a specified instance of Msvm_Processor by a key, get a default unnamed instance (singleton) of the class or list instances of the class by wmi query using this VB.Net sample code.
See in another language: VBScript, C#
'Project -> Add reference -> System.Management
'Imports System.Management

'Get the namespace management scope
Dim Scope As New ManagementScope("\\.\ROOT\virtualization\v2")

'Get a result of WML query 
Dim Query As New ObjectQuery("SELECT * FROM Msvm_Processor Where CreationClassName="Msvm_Processor"DeviceID="Microsoft:B637F347-6A0E-4DEC-AF52-BD70CB80A21D\\0\\0"SystemCreationClassName="Msvm_ComputerSystem"SystemName="W2012SDC"")

'Create object searcher
Dim Searcher As New ManagementObjectSearcher(Scope, Query)

'Get a collection of WMI objects
Dim queryCollection As ManagementObjectCollection = Searcher.Get

'Enumerate wmi object 
For Each mObject As ManagementObject In queryCollection
  'write out some property value
  Console.WriteLine("PowerOnHours : {0}", mObject("PowerOnHours"))
Next
comments powered by Disqus
WUtils.com