When i have the following:
ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_Processor");
ManagementObjectCollection myobject = searcher.Get();
foreach (ManagementObject item in myobject)
{
//Name
Console.WriteLine(item["Name"].ToString());
}
Is this going through each Physical Processor and obtaining the Name for that particular processor? I haven’t seen an instance were the foreach() iterates move than once… I’ve worked with Win32_Processor, Win32_BIOS, Win32_ComputerSystem, so on..
In this case, if the server has more than 1 physical processor, would this for-each have more than one iteration? How does it work?
Yes, it is true, by using the query:
there is an iteration per physical processor. You might be interested to take a look at the
DeviceId,SocketDesignationandNumberOfCoresproperties.