Solved

monitor information in powershell - windows 7

Posted on 2014-04-25
2
4,010 Views
Last Modified: 2016-11-23
how can i get the monitor information to look something like this on the output?
model: Dell e980
serial number: 533434344
Size: 16


what i currently use is this:
gwmi -computer $compname -Credential $creds WmiMonitorID -Namespace root\wmi | ForEach-Object {Write-Host "Model" (  $_.UserFriendlyName -notmatch 0 | foreach {[char]$_}) -join ""; (  $_.ProductCodeID -notmatch 0 | foreach {[char]$_}) -join ""; ( Write-Host "Monitor Size:"  $_.UserFriendlyNameLength -notmatch 0 | foreach {[char]$_}) -join "";}

Open in new window


and i end up getting these results
results
0
Comment
Question by:bbimis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 40

Accepted Solution

by:
footech earned 500 total points
ID: 40023912
I think you want something like this.
gwmi WmiMonitorID -Namespace root\wmi |
 Select @{n="Model";e={[System.Text.Encoding]::ASCII.GetString($_.UserFriendlyName -ne 00)}},
  @{n="Serial Number";e={[System.Text.Encoding]::ASCII.GetString($_.SerialNumberID -ne 00)}} |
 Format-List

Open in new window


Pretty sure you want the SerialNumberID property instead of ProductCodeID for the serial number.  I left out the size because I don't know of any property that contains that info.  There are a few methods for converting byte arrays to characters, I just used one that doesn't require the -join operator.
0
 

Author Closing Comment

by:bbimis
ID: 40027148
thanks!
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By default the complete memory dump option is disabled in windows . If we want to enable the complete memory dump for a diagnostic purpose, we have a solution for it. here we are using the registry method to enable this.
The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question