Q. How can I query processor cores or sockets using PowerShell?
To query processor cores or sockets, you run a script and follow specific procedures.
June 21, 2010
Q. How can I query processor cores or sockets using PowerShell?
A. To query processor cores or sockets, run
Get-WmiObject Win32_Processor; add -computername whatever
to query a remote computer (replacing whatever with a comma-separated list of computer names). There is a NumberOfCores property that has what you need. Each instance of Win32_Processor is a socket. This has only been the case since Windows Server 2008 and Windows Vista. Prior to that, you'll see an instance of Win32_Processor for each core, without any information on how many sockets those are spread across. The remarks on the Win32_Processor Class page explain this in more detail.
Do you have a Windows PowerShell question? Find more PowerShell FAQs, articles, and other resources at windowsitpro.com/go/DonJonesPowerShell.
About the Author
You May Also Like