Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > Win32_Processor and SystemName

Reply
Thread Tools Display Modes

Win32_Processor and SystemName

 
 
joe
Guest
Posts: n/a

 
      04-15-2008
How do I print out only the SystemName from Win32_Processor or
Win32_computerSystem


 
Reply With Quote
 
 
 
 
Pegasus \(MVP\)
Guest
Posts: n/a

 
      04-15-2008

"joe" <> wrote in message
news:...
> How do I print out only the SystemName from Win32_Processor or
> Win32_computerSystem


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


 
Reply With Quote
 
joe
Guest
Posts: n/a

 
      04-16-2008
Hi

What about the "system name" variable

I want to output

System Name

hostname

under one column in excel
"Pegasus (MVP)" <> wrote in message
news:...
>
> "joe" <> wrote in message
> news:...
>> How do I print out only the SystemName from Win32_Processor or
>> Win32_computerSystem

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



 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a

 
      04-16-2008
I'm not aware of a "System Name" variable. Where does
it occur?

"joe" <> wrote in message
news:...
> Hi
>
> What about the "system name" variable
>
> I want to output
>
> System Name
>
> hostname
>
> under one column in excel
> "Pegasus (MVP)" <> wrote in message
> news:...
>>
>> "joe" <> wrote in message
>> news:...
>>> How do I print out only the SystemName from Win32_Processor or
>>> Win32_computerSystem

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

>
>



 
Reply With Quote
 
joe
Guest
Posts: n/a

 
      04-17-2008
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)" <> wrote in message
news:...
> I'm not aware of a "System Name" variable. Where does
> it occur?
>
> "joe" <> wrote in message
> news:...
>> Hi
>>
>> What about the "system name" variable
>>
>> I want to output
>>
>> System Name
>>
>> hostname
>>
>> under one column in excel
>> "Pegasus (MVP)" <> wrote in message
>> news:...
>>>
>>> "joe" <> wrote in message
>>> news:...
>>>> How do I print out only the SystemName from Win32_Processor or
>>>> Win32_computerSystem
>>>
>>> Try this:
>>> Set objCompSet =
>>> GetObject("winmgmts:{impersonationLevel=impersonat e}!//./root/cimv2").ExecQuery("select
>>> Name from Win32_ComputerSystem")
>>> For Each objDetail In objCompSet
>>> WScript.echo objDetail.Name
>>> Next
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a

 
      04-17-2008
Can't tell - you're not giving us any definition of the object
objClass.Properties_.


"joe" <> wrote in message
news:...
> 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)" <> wrote in message
> news:...
>> I'm not aware of a "System Name" variable. Where does
>> it occur?
>>
>> "joe" <> wrote in message
>> news:...
>>> Hi
>>>
>>> What about the "system name" variable
>>>
>>> I want to output
>>>
>>> System Name
>>>
>>> hostname
>>>
>>> under one column in excel
>>> "Pegasus (MVP)" <> wrote in message
>>> news:...
>>>>
>>>> "joe" <> wrote in message
>>>> news:...
>>>>> How do I print out only the SystemName from Win32_Processor or
>>>>> Win32_computerSystem
>>>>
>>>> Try this:
>>>> Set objCompSet =
>>>> GetObject("winmgmts:{impersonationLevel=impersonat e}!//./root/cimv2").ExecQuery("select
>>>> Name from Win32_ComputerSystem")
>>>> For Each objDetail In objCompSet
>>>> WScript.echo objDetail.Name
>>>> Next
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
joe
Guest
Posts: n/a

 
      04-18-2008
Set colItems = objWMIService.ExecQuery _
("Select * from Win32_Processor")

"Pegasus (MVP)" <> wrote in message
news:...
> Can't tell - you're not giving us any definition of the object
> objClass.Properties_.
>
>
> "joe" <> wrote in message
> news:...
>> 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)" <> wrote in message
>> news:...
>>> I'm not aware of a "System Name" variable. Where does
>>> it occur?
>>>
>>> "joe" <> wrote in message
>>> news:...
>>>> Hi
>>>>
>>>> What about the "system name" variable
>>>>
>>>> I want to output
>>>>
>>>> System Name
>>>>
>>>> hostname
>>>>
>>>> under one column in excel
>>>> "Pegasus (MVP)" <> wrote in message
>>>> news:...
>>>>>
>>>>> "joe" <> wrote in message
>>>>> news:...
>>>>>> How do I print out only the SystemName from Win32_Processor or
>>>>>> Win32_computerSystem
>>>>>
>>>>> Try this:
>>>>> Set objCompSet =
>>>>> GetObject("winmgmts:{impersonationLevel=impersonat e}!//./root/cimv2").ExecQuery("select
>>>>> Name from Win32_ComputerSystem")
>>>>> For Each objDetail In objCompSet
>>>>> WScript.echo objDetail.Name
>>>>> Next
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Allan
Guest
Posts: n/a

 
      05-22-2008
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/libr...73(VS.85).aspx

Thanks,
Allan

"joe" <> wrote in message
news:...
> Set colItems = objWMIService.ExecQuery _
> ("Select * from Win32_Processor")
>
> "Pegasus (MVP)" <> wrote in message
> news:...
>> Can't tell - you're not giving us any definition of the object
>> objClass.Properties_.
>>
>>
>> "joe" <> wrote in message
>> news:...
>>> 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)" <> wrote in message
>>> news:...
>>>> I'm not aware of a "System Name" variable. Where does
>>>> it occur?
>>>>
>>>> "joe" <> wrote in message
>>>> news:...
>>>>> Hi
>>>>>
>>>>> What about the "system name" variable
>>>>>
>>>>> I want to output
>>>>>
>>>>> System Name
>>>>>
>>>>> hostname
>>>>>
>>>>> under one column in excel
>>>>> "Pegasus (MVP)" <> wrote in message
>>>>> news:...
>>>>>>
>>>>>> "joe" <> wrote in message
>>>>>> news:...
>>>>>>> How do I print out only the SystemName from Win32_Processor or
>>>>>>> Win32_computerSystem
>>>>>>
>>>>>> Try this:
>>>>>> Set objCompSet =
>>>>>> GetObject("winmgmts:{impersonationLevel=impersonat e}!//./root/cimv2").ExecQuery("select
>>>>>> Name from Win32_ComputerSystem")
>>>>>> For Each objDetail In objCompSet
>>>>>> WScript.echo objDetail.Name
>>>>>> Next
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>

 
Reply With Quote
 
Stefan Herman
Guest
Posts: n/a

 
      11-19-2011
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" <> wrote in message
>> news:...
>>
>> Try this:
>> Set objCompSet =
>> GetObject("winmgmts:{impersonationLevel=impersonat e}!//./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)" <> wrote in message
>>>>> news:...



>>>>>> 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")



>>>>>>>> On Wednesday, May 21, 2008 9:35 PM Allan wrote:


>>>>>>>> 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/libr...73(VS.85).aspx
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Allan
>>>>>>>>
>>>>>>>> "joe" <> wrote in message
>>>>>>>> news:...




 
Reply With Quote
 
David H. Lipman
Guest
Posts: n/a

 
      11-19-2011
From: "Stefan Herman" <>

> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59