none
Monitor Make Model and Seriel Number RRS feed

  • Question

  • 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

    • Moved by Bill_Stewart Wednesday, September 4, 2019 6:29 PM This is not "fix/debug/rewrite script for me" forum
    Monday, March 11, 2019 11:29 AM

All replies