Sunday, November 18, 2012

0 Get CPU/Socket/Core/Hyper-Threading from PowerShell

A while ago, I was been asked how to determine the Socket, CPU or Hyper-threading is enable on the Host.

The information can be retrieved from WMI’s Win32_processor . The problem is if you are on Win2003 or WinXP, the hotfix must apply  kb/932370 , otherwise the WMI may report the incorrect information.

Here is the simple PowerShell script to retrieve the information.

gwmi win32_computersystem | fl NumberOfProcessors, NumberOfLogicalProcessors
gwmi  win32_processor | ft NumberOfCores,NumberOfLogicalProcessors

Quart core – No Hyper threading

image

In the screenshot above, the NumberOflogicalprocessors is same as Numberofcores, that means the Hyper-threading is not enable.

We can use sysinternal tools coreinfo to verify the information.

image

Quart core – with Hyper threading

Here is another test on my Win2012 host with Intel(R) Core(TM) i7-3610QM CPU

The host is one socket with Quart core CPU and Hyper-threading enable,

image

Dual Core – No Hyper-threading

I use VMWare to emulate the 2 sockets host. The host has 2 sockets, Each Socket has 2 core but no hyper-threading enable.

image

The VMWare does not support the Multicore with HT enable. So I don’t have the test screenshot base on that.

0 comments:

Post a Comment

 

SQL Panda Copyright © 2011 - |- Template created by O Pregador - |- Powered by Blogger Templates