Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Processor

$
0
0

i want to check processor of all servers but i want remotly for all server . i tired this below script but it show  processor of local system every time .

i tired with this also  -ComputerName parameter also.

there is some loop prblem.can u help me out in tat 

 

 

foreach ($ComputerName in (Get-Content -Path C:\listofcomputer.txt)) 

$hostname = Get-WmiObject Win32_Computersystem -ComputerName $ComputerName |

 

    Select-Object -ExpandProperty Name

 

$colItems = Get-WmiObject -class Win32_Processor -Computername $Computername |

            Select-Object -ExpandProperty Name

 

    write-Host $hostname

    Write-Host "CPU Model: " -foregroundcolor black -NoNewLine 

    Write-Host $objItem.Name -foregroundcolor black 

    Write-Host 

}


Viewing all articles
Browse latest Browse all 6937