Deathjam

Untitled

Nov 16th, 2016
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Get-Monitorinfo
  2. {
  3.   $ManufacturerNames = @{
  4.     'AAC' = 'AcerView'
  5.     'ACR' = 'Acer'
  6.     'AOC' = 'AOC'
  7.     'AIC' = 'AG Neovo'
  8.     'APP' = 'Apple Computer'
  9.     'AST' = 'AST Research'
  10.     'AUO' = 'Asus'
  11.     'BNQ' = 'BenQ'
  12.     'CMO' = 'Acer'
  13.     'CPL' = 'Compal'
  14.     'CPQ' = 'Compaq'
  15.     'CPT' = 'Chunghwa Pciture Tubes, Ltd.'
  16.     'CTX' = 'CTX'
  17.     'DEC' = 'DEC'
  18.     'DEL' = 'Dell'
  19.     'DPC' = 'Delta'
  20.     'DWE' = 'Daewoo'
  21.     'EIZ' = 'EIZO'
  22.     'ELS' = 'ELSA'
  23.     'ENC' = 'EIZO'
  24.     'EPI' = 'Envision'
  25.     'FCM' = 'Funai'
  26.     'FUJ' = 'Fujitsu'
  27.     'FUS' = 'Fujitsu-Siemens'
  28.     'GSM' = 'LG Electronics'
  29.     'GWY' = 'Gateway 2000'
  30.     'HEI' = 'Hyundai'
  31.     'HIT' = 'Hyundai'
  32.     'HSL' = 'Hansol'
  33.     'HTC' = 'Hitachi/Nissei'
  34.     'HWP' = 'HP'
  35.     'IBM' = 'IBM'
  36.     'ICL' = 'Fujitsu ICL'
  37.     'IVM' = 'Iiyama'
  38.     'KDS' = 'Korea Data Systems'
  39.     'LEN' = 'Lenovo'
  40.     'LGD' = 'Asus'
  41.     'LPL' = 'Fujitsu'
  42.     'MAX' = 'Belinea'
  43.     'MEI' = 'Panasonic'
  44.     'MEL' = 'Mitsubishi Electronics'
  45.     'MS_' = 'Panasonic'
  46.     'NAN' = 'Nanao'
  47.     'NEC' = 'NEC'
  48.     'NOK' = 'Nokia Data'
  49.     'NVD' = 'Fujitsu'
  50.     'OPT' = 'Optoma'
  51.     'PHL' = 'Philips'
  52.     'REL' = 'Relisys'
  53.     'SAN' = 'Samsung'
  54.     'SAM' = 'Samsung'
  55.     'SBI' = 'Smarttech'
  56.     'SGI' = 'SGI'
  57.     'SNY' = 'Sony'
  58.     'SRC' = 'Shamrock'
  59.     'SUN' = 'Sun Microsystems'
  60.     'SEC' = 'Hewlett-Packard'
  61.     'TAT' = 'Tatung'
  62.     'TOS' = 'Toshiba'
  63.     'TSB' = 'Toshiba'
  64.     'VSC' = 'ViewSonic'
  65.     'ZCM' = 'Zenith'
  66.     'UNK' = 'Unknown'
  67.     '_YV' = 'Fujitsu'
  68.   }
  69.            
  70.   $Monitors = Get-WmiObject -ComputerName $strComp -ClassName wmimonitorid -Namespace root/wmi -ErrorAction SilentlyContinue
  71.   Foreach($Monitor in $Monitors)
  72.   {
  73.     $ShortManufacturer = [System.Text.Encoding]::ASCII.GetString($Monitor.ManufacturerName)
  74.     $Model = [System.Text.Encoding]::ASCII.GetString($Monitor.UserFriendlyName)
  75.     $SerialNumber = [System.Text.Encoding]::ASCII.GetString($Monitor.SerialNumberID)
  76.     $Manufacturer = $ManufacturerNames.$ShortManufacturer
  77.     If ($Manufacturer -eq $null)
  78.     {
  79.       $Manufacturer = $ShortManufacturer
  80.     }
  81.     New-Object -TypeName PSCustomObject -Property @{
  82.       Manufacturer = $Manufacturer
  83.       Model        = $Model
  84.       SerialNumber = $SerialNumber
  85.     }
  86.   }
  87. }
Advertisement
Add Comment
Please, Sign In to add comment