Discussion:
Win32_Processor and SystemName
(too old to reply)
joe
2008-04-15 02:30:14 UTC
Permalink
How do I print out only the SystemName from Win32_Processor or
Win32_computerSystem
Pegasus (MVP)
2008-04-15 07:17:03 UTC
Permalink
Post by joe
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
2008-04-16 05:28:22 UTC
Permalink
Hi

What about the "system name" variable

I want to output

System Name

hostname

under one column in excel
Post by Pegasus (MVP)
Post by joe
How do I print out only the SystemName from Win32_Processor or
Win32_computerSystem
Set objCompSet =
GetObject("winmgmts:{impersonationLevel=impersonate}!//./root/cimv2").ExecQuery("select
Name from Win32_ComputerSystem")
For Each objDetail In objCompSet
WScript.echo objDetail.Name
Next
Pegasus (MVP)
2008-04-16 14:28:18 UTC
Permalink
I'm not aware of a "System Name" variable. Where does
it occur?
Post by joe
Hi
What about the "system name" variable
I want to output
System Name
hostname
under one column in excel
Post by Pegasus (MVP)
Post by joe
How do I print out only the SystemName from Win32_Processor or
Win32_computerSystem
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
2008-04-17 02:52:40 UTC
Permalink
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
Post by Pegasus (MVP)
I'm not aware of a "System Name" variable. Where does
it occur?
Post by joe
Hi
What about the "system name" variable
I want to output
System Name
hostname
under one column in excel
Post by Pegasus (MVP)
Post by joe
How do I print out only the SystemName from Win32_Processor or
Win32_computerSystem
Set objCompSet =
GetObject("winmgmts:{impersonationLevel=impersonate}!//./root/cimv2").ExecQuery("select
Name from Win32_ComputerSystem")
For Each objDetail In objCompSet
WScript.echo objDetail.Name
Next
Pegasus (MVP)
2008-04-17 08:33:00 UTC
Permalink
Can't tell - you're not giving us any definition of the object
objClass.Properties_.
Post by joe
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
Post by Pegasus (MVP)
I'm not aware of a "System Name" variable. Where does
it occur?
Post by joe
Hi
What about the "system name" variable
I want to output
System Name
hostname
under one column in excel
Post by Pegasus (MVP)
Post by joe
How do I print out only the SystemName from Win32_Processor or
Win32_computerSystem
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
2008-04-18 03:00:47 UTC
Permalink
Set colItems = objWMIService.ExecQuery _
("Select * from Win32_Processor")
Post by Pegasus (MVP)
Can't tell - you're not giving us any definition of the object
objClass.Properties_.
Post by joe
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
Post by Pegasus (MVP)
I'm not aware of a "System Name" variable. Where does
it occur?
Post by joe
Hi
What about the "system name" variable
I want to output
System Name
hostname
under one column in excel
Post by Pegasus (MVP)
Post by joe
How do I print out only the SystemName from Win32_Processor or
Win32_computerSystem
Set objCompSet =
GetObject("winmgmts:{impersonationLevel=impersonate}!//./root/cimv2").ExecQuery("select
Name from Win32_ComputerSystem")
For Each objDetail In objCompSet
WScript.echo objDetail.Name
Next
Allan
2008-05-22 01:35:28 UTC
Permalink
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
Post by joe
Set colItems = objWMIService.ExecQuery _
("Select * from Win32_Processor")
Post by Pegasus (MVP)
Can't tell - you're not giving us any definition of the object
objClass.Properties_.
Post by joe
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
Post by Pegasus (MVP)
I'm not aware of a "System Name" variable. Where does
it occur?
Post by joe
Hi
What about the "system name" variable
I want to output
System Name
hostname
under one column in excel
Post by Pegasus (MVP)
Post by joe
How do I print out only the SystemName from Win32_Processor or
Win32_computerSystem
Set objCompSet =
GetObject("winmgmts:{impersonationLevel=impersonate}!//./root/cimv2").ExecQuery("select
Name from Win32_ComputerSystem")
For Each objDetail In objCompSet
WScript.echo objDetail.Name
Next
Stefan Herman
2011-11-19 01:56:49 UTC
Permalink
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
Post by joe
How do I print out only the SystemName from Win32_Processor or
Win32_computerSystem
Post by Pegasus (MVP)
Set objCompSet =
GetObject("winmgmts:{impersonationLevel=impersonate}!//./root/cimv2").ExecQuery("select
Name from Win32_ComputerSystem")
For Each objDetail In objCompSet
WScript.echo objDetail.Name
Next
Post by joe
Hi
What about the "system name" variable
I want to output
System Name
hostname
under one column in excel
I am not aware of a "System Name" variable. Where does
it occur?
Post by joe
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
Can't tell - you are not giving us any definition of the object
objClass.Properties_.
Post by joe
Set colItems = objWMIService.ExecQuery _
("Select * from Win32_Processor")
Post by Allan
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
http://msdn.microsoft.com/en-us/library/aa394373(VS.85).aspx
Thanks,
Allan
David H. Lipman
2011-11-19 12:45:06 UTC
Permalink
< snip >
< snip >
< 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
Loading...