SHARE
TWEET

monitor inventory

a guest Jul 16th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Function ConvertTo-Char
  2. (  
  3.     $Array
  4. )
  5. {
  6.     $Output = ""
  7.     ForEach($char in $Array)
  8.     {   $Output += [char]$char -join ""
  9.     }
  10.     return $Output
  11. }
  12.  
  13. $Query = Get-WmiObject -Query "Select * FROM WMIMonitorID" -Namespace root\wmi
  14.  
  15. $Results = ForEach ($Monitor in $Query)
  16. {    
  17.     New-Object PSObject -Property @{
  18.         ComputerName = $env:ComputerName
  19.         Active = $Monitor.Active
  20.         Manufacturer = ConvertTo-Char($Monitor.ManufacturerName)
  21.         UserFriendlyName = ConvertTo-Char($Monitor.userfriendlyname)
  22.         SerialNumber = ConvertTo-Char($Monitor.serialnumberid)
  23.         WeekOfManufacture = $Monitor.WeekOfManufacture
  24.         YearOfManufacture = $Monitor.WeekOfManufacture
  25.     }
  26. }
  27.  
  28. $Results | Select ComputerName,Active,Manufacturer,UserFriendlyName,SerialNumber,WeekOfManufacture,YearOfManufacture´╗┐
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top