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.

Don Jones

June 21, 2010

1 Min Read
Lava lamp with yellow blob on blue background

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.

 

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like