Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Win32_Processor and SystemName

92 views
Skip to first unread message

joe

unread,
Apr 14, 2008, 10:30:14 PM4/14/08
to
How do I print out only the SystemName from Win32_Processor or
Win32_computerSystem


Pegasus (MVP)

unread,
Apr 15, 2008, 3:17:03 AM4/15/08
to

"joe" <j...@abc.com> wrote in message
news:OIKykCqn...@TK2MSFTNGP02.phx.gbl...

> How do I print out only the SystemName from Win32_Processor or
> Win32_computerSystem

Try this:
Set objCompSet =
GetObject("winmgmts:{impersonationLevel=impersonate}!//./root/cimv2").ExecQuery("select
Name from Win32_ComputerSystem")
For Each objDetail In objCompSet
WScript.echo objDetail.Name
Next


joe

unread,
Apr 16, 2008, 1:28:22 AM4/16/08
to
Hi

What about the "system name" variable

I want to output

System Name

hostname

under one column in excel
"Pegasus (MVP)" <I....@fly.com.oz> wrote in message
news:u0aQ1isn...@TK2MSFTNGP03.phx.gbl...

Pegasus (MVP)

unread,
Apr 16, 2008, 10:28:18 AM4/16/08
to
I'm not aware of a "System Name" variable. Where does
it occur?

"joe" <j...@abc.com> wrote in message

news:eMHJyK4n...@TK2MSFTNGP03.phx.gbl...

joe

unread,
Apr 16, 2008, 10:52:40 PM4/16/08
to
when i run

For Each objProperty In objClass.Properties_
objSheet.Cells (intRow, intColumn) = objProperty.Name
intColumn = intColumn + 1
Next


There is a column called System Name

I want to output only this


"Pegasus (MVP)" <I....@fly.com.oz> wrote in message

news:ewBje48n...@TK2MSFTNGP05.phx.gbl...

Pegasus (MVP)

unread,
Apr 17, 2008, 4:33:00 AM4/17/08
to
Can't tell - you're not giving us any definition of the object
objClass.Properties_.


"joe" <j...@abc.com> wrote in message

news:uo3AcYDo...@TK2MSFTNGP03.phx.gbl...

joe

unread,
Apr 17, 2008, 11:00:47 PM4/17/08
to
Set colItems = objWMIService.ExecQuery _
("Select * from Win32_Processor")

"Pegasus (MVP)" <I....@fly.com.oz> wrote in message

news:eOGRnWGo...@TK2MSFTNGP02.phx.gbl...

Allan

unread,
May 21, 2008, 9:35:28 PM5/21/08
to
It should pull it. Here is an example:

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colProcessors = objWMIService.ExecQuery("Select * from Win32_Processor")
For Each objProcessor in colProcessors
WScript.Echo " SystemName: " & objProcessor.SystemName
Next

If you want more information, go to:
http://msdn.microsoft.com/en-us/library/aa394373(VS.85).aspx

Thanks,
Allan

"joe" <j...@abc.com> wrote in message

news:u1LkoBQo...@TK2MSFTNGP04.phx.gbl...

Stefan Herman

unread,
Nov 18, 2011, 8:56:49 PM11/18/11
to
hey all, I just wrote the below script to do this, although here's a one-liner as well:

PS C:\temp> gwmi Win32_Processor | Format-table SystemName,Name,NumberOfCores -auto

SystemName Name NumberOfCores
---------- --- -------
Server-01 Intel(R) Xeon(R)CPU X5460 @ 3.16GHz 4
Server-01 Intel(R) Xeon(R)CPU X5460 @ 3.16GHz 4


Script
=================================================

$strComputer = (hostname)
$OF = "C:\temp\CPUAudit.txt"
$Arr = @()
Write-Host Begin Processor Survey -ForegroundColor Yellow
Foreach ($Server in $strComputer) {
$Counter = 0
Write-Host Querying Processor information on $Server -ForegroundColor Magenta
$colItems = get-wmiobject -class Win32_Processor -computername $Server
foreach($objItem in $colItems){
$temp = New-Object system.Object
$temp | Add-Member -MemberType NoteProperty -Name "MachineName" -Value $objItem.SystemName
$temp | Add-Member -MemberType NoteProperty -Name "Description" -Value $objItem.Caption
$temp | Add-Member -MemberType NoteProperty -Name "CPU #" -Value $objItem.Name
$temp | Add-Member -MemberType NoteProperty -Name "# Cores" -Value $objItem.NumberOfCores
$Arr += $temp
$Counter++
}
Write-Host Query returned $Counter Procs on $Server
Write-Host =================
}
Write-host Processed $Arr.count Servers -ForegroundColor Green
$Arr | FT -autosize | Out-File $OF -Append

> On Monday, April 14, 2008 10:30 PM joe wrote:

> How do I print out only the SystemName from Win32_Processor or
> Win32_computerSystem


>> On Tuesday, April 15, 2008 3:17 AM Pegasus \(MVP\) wrote:

>> "joe" <j...@abc.com> wrote in message
>> news:OIKykCqn...@TK2MSFTNGP02.phx.gbl...
>>
>> Try this:
>> Set objCompSet =
>> GetObject("winmgmts:{impersonationLevel=impersonate}!//./root/cimv2").ExecQuery("select
>> Name from Win32_ComputerSystem")
>> For Each objDetail In objCompSet
>> WScript.echo objDetail.Name
>> Next


>>> On Wednesday, April 16, 2008 1:28 AM joe wrote:

>>> Hi
>>>
>>> What about the "system name" variable
>>>
>>> I want to output
>>>
>>> System Name
>>>
>>> hostname
>>>
>>> under one column in excel


>>>> On Wednesday, April 16, 2008 10:28 AM Pegasus \(MVP\) wrote:

>>>> I am not aware of a "System Name" variable. Where does
>>>> it occur?


>>>>> On Wednesday, April 16, 2008 10:52 PM joe wrote:

>>>>> when i run
>>>>>
>>>>> For Each objProperty In objClass.Properties_
>>>>> objSheet.Cells (intRow, intColumn) = objProperty.Name
>>>>> intColumn = intColumn + 1
>>>>> Next
>>>>>
>>>>>
>>>>> There is a column called System Name
>>>>>
>>>>> I want to output only this
>>>>> "Pegasus (MVP)" <I....@fly.com.oz> wrote in message
>>>>> news:ewBje48n...@TK2MSFTNGP05.phx.gbl...


>>>>>> On Thursday, April 17, 2008 4:33 AM Pegasus \(MVP\) wrote:

>>>>>> Can't tell - you are not giving us any definition of the object
>>>>>> objClass.Properties_.


>>>>>>> On Thursday, April 17, 2008 11:00 PM joe wrote:

>>>>>>> Set colItems = objWMIService.ExecQuery _
>>>>>>> ("Select * from Win32_Processor")


David H. Lipman

unread,
Nov 19, 2011, 7:45:06 AM11/19/11
to
From: "Stefan Herman" <ste...@live.com>

> hey all, I just wrote the below script to do this, although here's a one-liner as well:


< snip >

>>>>> On Wednesday, April 16, 2008 10:28 AM Pegasus \(MVP\) wrote:

< snip >

>>>>>> On Wednesday, April 16, 2008 10:52 PM joe wrote:


< snip >

You only too 3.5 years.


--
Dave
Multi-AV Scanning Tool - http://multi-av.thespykiller.co.uk
http://www.pctipp.ch/downloads/dl/35905.asp


0 new messages