I found the script below, however I would like to inventory a list of computers and output the results to a CSV. Could someone assist if at all possible? Thanks!
Function ConvertTo-Char
(
$Array
)
{
$Output = ""
ForEach($char in $Array)
{ $Output += [char]$char -join ""
}
return $Output
}
$Query = Get-WmiObject -Query "Select * FROM WMIMonitorID" -Namespace root\wmi
$Results = ForEach ($Monitor in $Query)
{
New-Object PSObject -Property @{
ComputerName = $env:ComputerName
Active = $Monitor.Active
Manufacturer = ConvertTo-Char($Monitor.ManufacturerName)
MakeModel = ConvertTo-Char($Monitor.userfriendlyname)
SerialNumber = ConvertTo-Char($Monitor.serialnumberid)
WeekOfManufacture = $Monitor.WeekOfManufacture
YearOfManufacture = $Monitor.WeekOfManufacture
}
}
$Results | Select ComputerName,MakeModel,SerialNumber
Lee