LastErrorCode - property in ROOT\virtualization\v2 namespace

LastErrorCode in other namespaces

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

propertyClassOrigin
LastErrorCodeCIM_LogicalDeviceCIM_LogicalDevice

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

propertyClassOrigin
LastErrorCodeCIM_CDROMDriveCIM_LogicalDevice
LastErrorCodeCIM_ControllerCIM_LogicalDevice
LastErrorCodeCIM_DesktopMonitorCIM_LogicalDevice
LastErrorCodeCIM_DiskDriveCIM_LogicalDevice
LastErrorCodeCIM_DisketteDriveCIM_LogicalDevice
LastErrorCodeCIM_DisplayCIM_LogicalDevice
LastErrorCodeCIM_DisplayControllerCIM_LogicalDevice
LastErrorCodeCIM_DVDDriveCIM_LogicalDevice
LastErrorCodeCIM_EthernetPortCIM_LogicalDevice
LastErrorCodeCIM_FCPortCIM_LogicalDevice
LastErrorCodeCIM_IDEControllerCIM_LogicalDevice
LastErrorCodeCIM_LogicalDiskCIM_LogicalDevice
LastErrorCodeCIM_LogicalPortCIM_LogicalDevice
LastErrorCodeCIM_MediaAccessDeviceCIM_LogicalDevice
LastErrorCodeCIM_MemoryCIM_LogicalDevice
LastErrorCodeCIM_NetworkPortCIM_LogicalDevice
LastErrorCodeCIM_PointingDeviceCIM_LogicalDevice
LastErrorCodeCIM_ProcessorCIM_LogicalDevice
LastErrorCodeCIM_ProtocolControllerCIM_LogicalDevice
LastErrorCodeCIM_SCSIProtocolControllerCIM_LogicalDevice
LastErrorCodeCIM_SerialControllerCIM_LogicalDevice
LastErrorCodeCIM_StorageExtentCIM_LogicalDevice
LastErrorCodeCIM_TapeDriveCIM_LogicalDevice
LastErrorCodeCIM_USBDeviceCIM_LogicalDevice
LastErrorCodeCIM_UserDeviceCIM_LogicalDevice
LastErrorCodeCIM_VideoHeadCIM_LogicalDevice
LastErrorCodeCIM_WiFiPortCIM_LogicalDevice
LastErrorCodeMsvm_DiskDriveCIM_LogicalDevice
LastErrorCodeMsvm_DisketteControllerCIM_LogicalDevice
LastErrorCodeMsvm_DisketteDriveCIM_LogicalDevice
LastErrorCodeMsvm_DVDDriveCIM_LogicalDevice
LastErrorCodeMsvm_EmulatedEthernetPortCIM_LogicalDevice
LastErrorCodeMsvm_EthernetSwitchPortCIM_LogicalDevice
LastErrorCodeMsvm_ExternalEthernetPortCIM_LogicalDevice
LastErrorCodeMsvm_ExternalFcPortCIM_LogicalDevice
LastErrorCodeMsvm_FcSwitchPortCIM_LogicalDevice
LastErrorCodeMsvm_GuestServiceInterfaceComponentCIM_LogicalDevice
LastErrorCodeMsvm_HeartbeatComponentCIM_LogicalDevice
LastErrorCodeMsvm_IDEControllerCIM_LogicalDevice
LastErrorCodeMsvm_InternalEthernetPortCIM_LogicalDevice
LastErrorCodeMsvm_KeyboardCIM_LogicalDevice
LastErrorCodeMsvm_KvpExchangeComponentCIM_LogicalDevice
LastErrorCodeMsvm_LogicalDiskCIM_LogicalDevice
LastErrorCodeMsvm_MemoryCIM_LogicalDevice
LastErrorCodeMsvm_Physical3dGraphicsProcessorCIM_LogicalDevice
LastErrorCodeMsvm_ProcessorCIM_LogicalDevice
LastErrorCodeMsvm_Ps2MouseCIM_LogicalDevice
LastErrorCodeMsvm_RdvComponentCIM_LogicalDevice
LastErrorCodeMsvm_S3DisplayControllerCIM_LogicalDevice
LastErrorCodeMsvm_SCSIProtocolControllerCIM_LogicalDevice
LastErrorCodeMsvm_SerialControllerCIM_LogicalDevice
LastErrorCodeMsvm_SerialPortCIM_LogicalDevice
LastErrorCodeMsvm_ShutdownComponentCIM_LogicalDevice
LastErrorCodeMsvm_Synthetic3DDisplayControllerCIM_LogicalDevice
LastErrorCodeMsvm_SyntheticDisplayControllerCIM_LogicalDevice
LastErrorCodeMsvm_SyntheticEthernetPortCIM_LogicalDevice
LastErrorCodeMsvm_SyntheticFcPortCIM_LogicalDevice
LastErrorCodeMsvm_SyntheticMouseCIM_LogicalDevice
LastErrorCodeMsvm_TimeSyncComponentCIM_LogicalDevice
LastErrorCodeMsvm_VideoHeadCIM_LogicalDevice
LastErrorCodeMsvm_VssComponentCIM_LogicalDevice
LastErrorCodeMsvm_WiFiPortCIM_LogicalDevice

Code samples for LastErrorCode property

Get instance of WMI class using GetObject, LastErrorCode 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.LastErrorCode 'or other property name, see properties
See more VBS samples of Msvm_Processor class

WMI query - sample windows WQL with C#, LastErrorCode 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("LastErrorCode : {0}", m["LastErrorCode"]);
  
}

WMI query - sample windows WQL with VB.Net, LastErrorCode 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("LastErrorCode : {0}", mObject("LastErrorCode"))
Next
comments powered by Disqus
WUtils.com