?
Solved

monitor information in powershell - windows 7

Posted on 2014-04-25
2
Medium Priority
?
4,179 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 2000 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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
Previously, on our Nano Server Deployment series, we've created a new nano server image and deployed it on a physical server in part 2. Now we will go through configuration.
This Micro Tutorial will go in depth within Systems and Security in Windows 7 and will go into detail regarding Action Center, Windows Firewall, System, etc. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a basic overview of Windows Live Photo Gallery and show you various editing filters and touches to photos you can apply. This will be demonstrated using Windows Live Photo Gallery on Windows 7 operating system.
Suggested Courses

752 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