Nick MacKechnie
#8 wire kinda guy.....

WMI Script to count physical processors in a Server

Friday, 4 July 2008 05:10 by Nick MacKechnie

Option 1.

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")

Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Processor")

For Each objItem in colItems

    Wscript.Echo "Processor: " & objItem.Name

    Wscript.Echo "NumberOfLogicalProcessors: " & objItem.NumberOfLogicalProcessors

    Wscript.Echo "NumberOfCores: " & objItem.NumberOfCores

    Wscript.Echo

Next

<<<<<<<<<<<<<<<<<< OR  >>>>>>>>>>>>>>>

Option 2.

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")

Set colCSes = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem")

For Each objCS In colCSes

  WScript.Echo "Computer Name: " & objCS.Name

  WScript.Echo "System Type: " & objCS.SystemType

  WScript.Echo "Number Of Physical Processors: " & objCS.NumberOfProcessors

  WScript.Echo "Number of Logical Processors: " & objCS.NumberofLogicalProcessors

Next

Currently rated 1.0 by 3 people

  • Currently 1/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:  
Categories:   My Opinion | Tips | Tools
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Comments