state - property in ROOT\WMI namespace

state in other namespaces

List of classes with state local property in ROOT\WMI namespace

propertyClassOrigin
stateAcpiPssAcpiPss
stateapp_domain_ring_buffer_recordedapp_domain_ring_buffer_recorded
statebroker_dialog_state_changebroker_dialog_state_change
statebroker_transmission_acksm_event_beginbroker_transmission_acksm_event_begin
statebroker_transmission_acksm_event_endbroker_transmission_acksm_event_end
statebroker_transmission_deliverysm_event_beginbroker_transmission_deliverysm_event_begin
statebroker_transmission_deliverysm_event_endbroker_transmission_deliverysm_event_end
statebroker_transport_connection_event_beginbroker_transport_connection_event_begin
statebroker_transport_connection_event_endbroker_transport_connection_event_end
stateconnectivity_ring_buffer_recordedconnectivity_ring_buffer_recorded
stateerror_reportederror_reported
stateexception_ring_buffer_recordedexception_ring_buffer_recorded
statefastloadcontext_enabledfastloadcontext_enabled
stateglm_acquire_database_lock_exceptionglm_acquire_database_lock_exception
stateglm_acquire_table_lock_exceptionglm_acquire_table_lock_exception
stateglm_release_database_lock_exceptionglm_release_database_lock_exception
stateglm_release_table_lock_exceptionglm_release_table_lock_exception
statehost_task_ring_buffer_recordedhost_task_ring_buffer_recorded
stateIdleAccountingIdleAccounting
stateIdleAccountingExIdleAccountingEx
stateISCSI_ConnectionStaticInfoISCSI_ConnectionStaticInfo
stateKernelIdleStatesKernelIdleStates
stateKernelPerfStateChangeKernelPerfStateChange
stateKernelPerfStateDomainChangeKernelPerfStateDomainChange
stateKernelPerfStatesKernelPerfStates
statelarge_cache_caching_decisionlarge_cache_caching_decision
statelarge_cache_entry_value_changelarge_cache_entry_value_change
statelock_request_priority_statelock_request_priority_state
statePerformanceStatesPerformanceStates
stateProcessorAcpiCstProcessorAcpiCst
stateProcessorAcpiTssProcessorAcpiTss
stateProcessorAcpiXpssProcessorAcpiXpss
statequery_scan_shutdownquery_scan_shutdown
statesession_recoverable_state_changesession_recoverable_state_change
statesp_server_diagnostics_component_resultsp_server_diagnostics_component_result
statesp_statement_startingsp_statement_starting
statesql_statement_startingsql_statement_starting
statetask_abortedtask_aborted

Code samples for state property

Get instance of WMI class using GetObject, state property of KernelIdleStates

Short VBS code - get a single specified instance of KernelIdleStates 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\WMI:" + _
 "KernelIdleStates.InstanceName=""PPM_Processor_0""")
Wscript.Echo wmiObject.state 'or other property name, see properties
See more VBS samples of KernelIdleStates class

WMI query - sample windows WQL with C#, state property of KernelIdleStates

Get a specified instance of KernelIdleStates 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\\WMI");

//create object query
ObjectQuery query = new ObjectQuery("SELECT * FROM KernelIdleStates Where InstanceName=\"PPM_Processor_0\"");

//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("state : {0}", m["state"]);
  
}

WMI query - sample windows WQL with VB.Net, state property of KernelIdleStates

Get a specified instance of KernelIdleStates 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\WMI")

'Get a result of WML query 
Dim Query As New ObjectQuery("SELECT * FROM KernelIdleStates Where InstanceName="PPM_Processor_0"")

'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("state : {0}", mObject("state"))
Next
comments powered by Disqus
WUtils.com