And here the powershell script:
(Get-Content C:\Zvonko\computerList.txt).Trim() | ForEach {
$Computer = $_
If (Test-Connection -ComputerName $Computer -Count 1 -Quiet) {
Write-Host "Computer: $Computer"
$Sytem = Get-WmiObject Win32_ComputerSystem -Computer $Computer
$Bios = Get-WmiObject Win32_Bios -Computer $Computer
$props = @{
ComputerName = $Computer
Manufacturer = $Sytem.Manufacturer
Model = $Sytem.Model
SerialNumber = $Bios.SerialNumber
}
New-Object PsObject -Property $props
} Else {
Write-Warning "Computer $Computer cannot be reached, skipping."
}
} | Sort ComputerName |
Select ComputerName,Manufacturer,Model,SerialNumber |
Export-Csv C:\Zvonko\computerDetails.csv -NoTypeInformation
PS. If you attach one such spreadsheet file here then I can change my script to read directly your ComputerNames column : )
You are welcome.
Open in new window
Open in new window