Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > Win32_ComputerSystem
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 9th August 09:56
eric
External User
 
Posts: 1
Default Win32_ComputerSystem



poll a machine for inventory using WMI. Works great.

I use the following routine to get the "Number of processors"

Set colSettings = objWMIService.ExecQuery ("Select * from
Win32_ComputerSystem",,48)
For Each objComputer2 in colSettings
intProcessorCount = formatNumber(objComputer.NumberOfProcessors)
Next

Again, nothing wrong with the code, except recently on some new PC's
we've gotten it returns a processor count of 2. (even though it is just
a single processor PC).

I checked the PC's device manager and it lists 2 processors. My
suspicion is that this is "Hyper-Threading" being detected. (since
these are new pcs)

Anyone know how to query WMI to see if HT is on the processor?
(thereby I can just subtract 1 processor if there is HT enabled)
  Reply With Quote


  sponsored links


2 9th August 09:56
john smith
External User
 
Posts: 1
Default Win32_ComputerSystem



It could be 3 things:
-a CPU with HyperThreading
-a Dual Core CPU
-two CPUs

WMI has no direct means/features to detect hyperthreading and the like.
Usually people will enumerate CPUs using Winn32_Processor (same issues
though). You can try different things (see if SocketDesignation changes
and such - but that's not overly reliable). Other possibilities are
using the ProcessorId property of the Win32_Processor instance, which
does contain partial CPUID infos (don't recall which registers, in what
order, or called with EAX=?; MSDN should have all the details you
want/need). Some people will make some fancy classes with all kinds of
tests (like, if it returns "GenuineIntel" and that it's a P4 then they
test for HT, etc)
  Reply With Quote
3 9th August 09:56
eric
External User
 
Posts: 1
Default Win32_ComputerSystem


Thanks for the post. Wanted to at least confirm my suspicion and
you've given me some ways around it. (I guess my goal was to keep this
inventory program simple, but as I dig deeper it seems I get stuff like
this to account for) /grin

I mainly don't care about the processor count, outside of our servers
which I inventory too, so I guess I'll just ignore the 2 processor
count on the Secretary's PC /grin
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666