DeviceId - property in ROOT\virtualization\v2 namespace

DeviceId in other namespaces

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

propertyClassOrigin
DeviceIdCIM_LogicalDeviceCIM_LogicalDevice
DeviceIdMsvm_EthernetPortDataMsvm_EthernetPortData

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

propertyClassOrigin
DeviceIdCIM_CDROMDriveCIM_LogicalDevice
DeviceIdCIM_ControllerCIM_LogicalDevice
DeviceIdCIM_DesktopMonitorCIM_LogicalDevice
DeviceIdCIM_DiskDriveCIM_LogicalDevice
DeviceIdCIM_DisketteDriveCIM_LogicalDevice
DeviceIdCIM_DisplayCIM_LogicalDevice
DeviceIdCIM_DisplayControllerCIM_LogicalDevice
DeviceIdCIM_DVDDriveCIM_LogicalDevice
DeviceIdCIM_EthernetPortCIM_LogicalDevice
DeviceIdCIM_FCPortCIM_LogicalDevice
DeviceIdCIM_IDEControllerCIM_LogicalDevice
DeviceIdCIM_LogicalDiskCIM_LogicalDevice
DeviceIdCIM_LogicalPortCIM_LogicalDevice
DeviceIdCIM_MediaAccessDeviceCIM_LogicalDevice
DeviceIdCIM_MemoryCIM_LogicalDevice
DeviceIdCIM_NetworkPortCIM_LogicalDevice
DeviceIdCIM_PointingDeviceCIM_LogicalDevice
DeviceIdCIM_ProcessorCIM_LogicalDevice
DeviceIdCIM_ProtocolControllerCIM_LogicalDevice
DeviceIdCIM_SCSIProtocolControllerCIM_LogicalDevice
DeviceIdCIM_SerialControllerCIM_LogicalDevice
DeviceIdCIM_StorageExtentCIM_LogicalDevice
DeviceIdCIM_TapeDriveCIM_LogicalDevice
DeviceIdCIM_USBDeviceCIM_LogicalDevice
DeviceIdCIM_UserDeviceCIM_LogicalDevice
DeviceIdCIM_VideoHeadCIM_LogicalDevice
DeviceIdCIM_WiFiPortCIM_LogicalDevice
DeviceIdMsvm_DiskDriveCIM_LogicalDevice
DeviceIdMsvm_DisketteControllerCIM_LogicalDevice
DeviceIdMsvm_DisketteDriveCIM_LogicalDevice
DeviceIdMsvm_DVDDriveCIM_LogicalDevice
DeviceIdMsvm_EmulatedEthernetPortCIM_LogicalDevice
DeviceIdMsvm_EthernetSwitchPortCIM_LogicalDevice
DeviceIdMsvm_EthernetSwitchPortBandwidthDataMsvm_EthernetPortData
DeviceIdMsvm_EthernetSwitchPortOffloadDataMsvm_EthernetPortData
DeviceIdMsvm_ExternalEthernetPortCIM_LogicalDevice
DeviceIdMsvm_ExternalFcPortCIM_LogicalDevice
DeviceIdMsvm_FcSwitchPortCIM_LogicalDevice
DeviceIdMsvm_GuestServiceInterfaceComponentCIM_LogicalDevice
DeviceIdMsvm_HeartbeatComponentCIM_LogicalDevice
DeviceIdMsvm_IDEControllerCIM_LogicalDevice
DeviceIdMsvm_InternalEthernetPortCIM_LogicalDevice
DeviceIdMsvm_KeyboardCIM_LogicalDevice
DeviceIdMsvm_KvpExchangeComponentCIM_LogicalDevice
DeviceIdMsvm_LogicalDiskCIM_LogicalDevice
DeviceIdMsvm_MemoryCIM_LogicalDevice
DeviceIdMsvm_Physical3dGraphicsProcessorCIM_LogicalDevice
DeviceIdMsvm_ProcessorCIM_LogicalDevice
DeviceIdMsvm_Ps2MouseCIM_LogicalDevice
DeviceIdMsvm_RdvComponentCIM_LogicalDevice
DeviceIdMsvm_S3DisplayControllerCIM_LogicalDevice
DeviceIdMsvm_SCSIProtocolControllerCIM_LogicalDevice
DeviceIdMsvm_SerialControllerCIM_LogicalDevice
DeviceIdMsvm_SerialPortCIM_LogicalDevice
DeviceIdMsvm_ShutdownComponentCIM_LogicalDevice
DeviceIdMsvm_Synthetic3DDisplayControllerCIM_LogicalDevice
DeviceIdMsvm_SyntheticDisplayControllerCIM_LogicalDevice
DeviceIdMsvm_SyntheticEthernetPortCIM_LogicalDevice
DeviceIdMsvm_SyntheticFcPortCIM_LogicalDevice
DeviceIdMsvm_SyntheticMouseCIM_LogicalDevice
DeviceIdMsvm_TimeSyncComponentCIM_LogicalDevice
DeviceIdMsvm_VideoHeadCIM_LogicalDevice
DeviceIdMsvm_VssComponentCIM_LogicalDevice
DeviceIdMsvm_WiFiPortCIM_LogicalDevice

Code samples for DeviceId property

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

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

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