Dim objWMIService, colItems, objItem, strComputer, intSocketsTotal, strSocketsAll
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Processor", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly)
strSocketsAll = ""
intSocketsTotal = 0
For Each objItem In colItems
Wscript.Echo "Socket Name: " & objItem.SocketDesignation
If Instr(strSocketsAll, objItem.SocketDesignation) = 0 Then
intSocketsTotal = intSocketsTotal + 1
strSocketsAll = strSocketsAll & objItem.SocketDesignation
End If
Next
WScript.Echo "Socket Count: " & intSocketsTotal
set wmi_service = GetObject("winmgmts:\\" & server_name)
set wmi_objectset = wmi_service.InstancesOf("Win32_Processor")
for each wmi_object in wmi_objectset
wscript.echo "Clock Speed: " & cstr(wmi_object.MaxClockSpeed) & " GHz"
wscript.echo "Core Count: " & cstr(wmi_object.NumberOfCores)
next
set wmi_service = nothing