Powershell – Use SCOM 2012, WMI, or Powershell to identify all servers that have hyper threading turned off

powershellscomwmi

We recently setup SCOM 2012 and deployed agents to all of our servers. We also have noticed that a number of these servers do not have hyper threading enabled, which they should. Is there any way we can use SCOM or WMI to find which servers do not have Hyper Threading turned on. My thought is that I should be able to find all systems where total cores = total threads, as this is an indication that Hyper Threading is disabled (or not available).

Example from Server 2012 Task Manager (12 cores and 12 "logical processors"/threads, should be 24 threads):

This needs Hyper Threading

Best Answer

The following Powershell script uses WMI to find which computers do not have Hyper Threading turned on by comparing cores to threads. You should run it in an Administrative console using as a Domain Administrator account:

$cs = Get-ADComputer -LDAPFilter "(name=host*)"
foreach($c in $cs){
    gWmi -class Win32_Processor -ComputerName $c.Name | select SystemName,DeviceID,Number*
}

This shows the CPU core and thread counts for all computers in Active Directory who's name starts with host. If there are multiple CPUs they will show up as CPU0, CPU1, etc. Example:

enter image description here

I still think there should be a way to use SCOM to do this, but the above works.

Related Topic