TimeOfLastStateChange - property in ROOT\CIMV2\storage\iscsitarget namespace

TimeOfLastStateChange in other namespaces

List of classes with TimeOfLastStateChange local property in ROOT\CIMV2\storage\iscsitarget namespace

propertyClassOrigin
TimeOfLastStateChangeCIM_ConcreteJobCIM_ConcreteJob
TimeOfLastStateChangeCIM_EnabledLogicalElementCIM_EnabledLogicalElement

List of classes with TimeOfLastStateChange derived property in ROOT\CIMV2\storage\iscsitarget namespace

propertyClassOrigin
TimeOfLastStateChangeCIM_AuthenticationServiceCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_ComputerSystemCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_ControllerConfigurationServiceCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_EthernetPortCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_IdentityManagementServiceCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_IPProtocolEndpointCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_iSCSIConfigurationServiceCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_iSCSIConnectionCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_iSCSIProtocolEndpointCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_iSCSISessionCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_LogicalDeviceCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_LogicalPortCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_NetworkPipeCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_NetworkPortCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_ObjectManagerCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_ObjectManagerCommunicationMechanismCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_ProtocolControllerCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_ProtocolEndpointCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_ReplicationServiceCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_SCSIProtocolControllerCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_SCSIProtocolEndpointCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_SecurityServiceCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_ServiceCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_ServiceAccessPointCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_StorageConfigurationServiceCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_StorageExtentCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_StorageHardwareIDManagementServiceCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_StorageVolumeCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_SystemCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_TCPProtocolEndpointCIM_EnabledLogicalElement
TimeOfLastStateChangeCIM_WBEMServiceCIM_EnabledLogicalElement
TimeOfLastStateChangeMSFTSM_ComputerSystemCIM_EnabledLogicalElement
TimeOfLastStateChangeMSFTSM_ObjectManagerCIM_EnabledLogicalElement
TimeOfLastStateChangeMSFTSM_SystemCIM_EnabledLogicalElement
TimeOfLastStateChangeMSFTSM_WSManCommunicationMechanismCIM_EnabledLogicalElement
TimeOfLastStateChangeMSFTSMNET_EthernetPortCIM_EnabledLogicalElement
TimeOfLastStateChangeMSFTSMNET_IPProtocolEndpointCIM_EnabledLogicalElement
TimeOfLastStateChangeMSISCSITARGET_ConcreteJobCIM_ConcreteJob
TimeOfLastStateChangeMSISCSITARGET_ControllerConfigurationServiceCIM_EnabledLogicalElement
TimeOfLastStateChangeMSISCSITARGET_iSCSIConfigurationServiceCIM_EnabledLogicalElement
TimeOfLastStateChangeMSISCSITARGET_iSCSIConnectionCIM_EnabledLogicalElement
TimeOfLastStateChangeMSISCSITARGET_iSCSIProtocolEndpointCIM_EnabledLogicalElement
TimeOfLastStateChangeMSISCSITARGET_iSCSISessionCIM_EnabledLogicalElement
TimeOfLastStateChangeMSISCSITARGET_ReplicationServiceCIM_EnabledLogicalElement
TimeOfLastStateChangeMSISCSITARGET_SCSIProtocolControllerCIM_EnabledLogicalElement
TimeOfLastStateChangeMSISCSITARGET_StorageConfigurationServiceCIM_EnabledLogicalElement
TimeOfLastStateChangeMSISCSITARGET_StorageHardwareIDManagementServiceCIM_EnabledLogicalElement
TimeOfLastStateChangeMSISCSITARGET_StorageVolumeCIM_EnabledLogicalElement
TimeOfLastStateChangeMSISCSITARGET_TCPProtocolEndpointCIM_EnabledLogicalElement

Code samples for TimeOfLastStateChange property

Get instance of WMI class using GetObject, TimeOfLastStateChange property of MSFTSM_WSManCommunicationMechanism

Short VBS code - get a single specified instance of MSFTSM_WSManCommunicationMechanism 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\CIMV2\storage\iscsitarget:" + _
 "MSFTSM_WSManCommunicationMechanism.CreationClassName=""MSFTSM_WSManCommunicationMechanism"",Name=""MSFT:SM.WS-Management"",SystemCreationClassName=""MSFTSM_System"",SystemName=""MS iSCSITarget: ..rootdomain.com""")
Wscript.Echo wmiObject.TimeOfLastStateChange 'or other property name, see properties
See more VBS samples of MSFTSM_WSManCommunicationMechanism class

WMI query - sample windows WQL with C#, TimeOfLastStateChange property of MSFTSM_WSManCommunicationMechanism

Get a specified instance of MSFTSM_WSManCommunicationMechanism 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\\CIMV2\\storage\\iscsitarget");

//create object query
ObjectQuery query = new ObjectQuery("SELECT * FROM MSFTSM_WSManCommunicationMechanism Where CreationClassName=\"MSFTSM_WSManCommunicationMechanism\"Name=\"MSFT:SM.WS-Management\"SystemCreationClassName=\"MSFTSM_System\"SystemName=\"MS iSCSITarget: W2012SDC.rootdomain.com\"");

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

WMI query - sample windows WQL with VB.Net, TimeOfLastStateChange property of MSFTSM_WSManCommunicationMechanism

Get a specified instance of MSFTSM_WSManCommunicationMechanism 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\CIMV2\storage\iscsitarget")

'Get a result of WML query 
Dim Query As New ObjectQuery("SELECT * FROM MSFTSM_WSManCommunicationMechanism Where CreationClassName="MSFTSM_WSManCommunicationMechanism"Name="MSFT:SM.WS-Management"SystemCreationClassName="MSFTSM_System"SystemName="MS iSCSITarget: W2012SDC.rootdomain.com"")

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