Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Get-Monitorinfo
- {
- $ManufacturerNames = @{
- 'AAC' = 'AcerView'
- 'ACR' = 'Acer'
- 'AOC' = 'AOC'
- 'AIC' = 'AG Neovo'
- 'APP' = 'Apple Computer'
- 'AST' = 'AST Research'
- 'AUO' = 'Asus'
- 'BNQ' = 'BenQ'
- 'CMO' = 'Acer'
- 'CPL' = 'Compal'
- 'CPQ' = 'Compaq'
- 'CPT' = 'Chunghwa Pciture Tubes, Ltd.'
- 'CTX' = 'CTX'
- 'DEC' = 'DEC'
- 'DEL' = 'Dell'
- 'DPC' = 'Delta'
- 'DWE' = 'Daewoo'
- 'EIZ' = 'EIZO'
- 'ELS' = 'ELSA'
- 'ENC' = 'EIZO'
- 'EPI' = 'Envision'
- 'FCM' = 'Funai'
- 'FUJ' = 'Fujitsu'
- 'FUS' = 'Fujitsu-Siemens'
- 'GSM' = 'LG Electronics'
- 'GWY' = 'Gateway 2000'
- 'HEI' = 'Hyundai'
- 'HIT' = 'Hyundai'
- 'HSL' = 'Hansol'
- 'HTC' = 'Hitachi/Nissei'
- 'HWP' = 'HP'
- 'IBM' = 'IBM'
- 'ICL' = 'Fujitsu ICL'
- 'IVM' = 'Iiyama'
- 'KDS' = 'Korea Data Systems'
- 'LEN' = 'Lenovo'
- 'LGD' = 'Asus'
- 'LPL' = 'Fujitsu'
- 'MAX' = 'Belinea'
- 'MEI' = 'Panasonic'
- 'MEL' = 'Mitsubishi Electronics'
- 'MS_' = 'Panasonic'
- 'NAN' = 'Nanao'
- 'NEC' = 'NEC'
- 'NOK' = 'Nokia Data'
- 'NVD' = 'Fujitsu'
- 'OPT' = 'Optoma'
- 'PHL' = 'Philips'
- 'REL' = 'Relisys'
- 'SAN' = 'Samsung'
- 'SAM' = 'Samsung'
- 'SBI' = 'Smarttech'
- 'SGI' = 'SGI'
- 'SNY' = 'Sony'
- 'SRC' = 'Shamrock'
- 'SUN' = 'Sun Microsystems'
- 'SEC' = 'Hewlett-Packard'
- 'TAT' = 'Tatung'
- 'TOS' = 'Toshiba'
- 'TSB' = 'Toshiba'
- 'VSC' = 'ViewSonic'
- 'ZCM' = 'Zenith'
- 'UNK' = 'Unknown'
- '_YV' = 'Fujitsu'
- }
- $Monitors = Get-WmiObject -ComputerName $strComp -ClassName wmimonitorid -Namespace root/wmi -ErrorAction SilentlyContinue
- Foreach($Monitor in $Monitors)
- {
- $ShortManufacturer = [System.Text.Encoding]::ASCII.GetString($Monitor.ManufacturerName)
- $Model = [System.Text.Encoding]::ASCII.GetString($Monitor.UserFriendlyName)
- $SerialNumber = [System.Text.Encoding]::ASCII.GetString($Monitor.SerialNumberID)
- $Manufacturer = $ManufacturerNames.$ShortManufacturer
- If ($Manufacturer -eq $null)
- {
- $Manufacturer = $ShortManufacturer
- }
- New-Object -TypeName PSCustomObject -Property @{
- Manufacturer = $Manufacturer
- Model = $Model
- SerialNumber = $SerialNumber
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment