PowerShell for Windows Admins

Jun 15 2011   12:53PM GMT

root\wmi–Monitor information

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

Continuing our intermittent browse through the root\wmi namespace we find a set of classes that seem to be linked to monitors

Get-WmiObject -Namespace root\wmi -List WmiMonitor*

WmiMonitorBrightnessEvent
WmiMonitorConnectionParams
WmiMonitorRawEEdidV1Block
WmiMonitorListedFrequencyRanges
WmiMonitorDigitalVideoInputParams
WmiMonitorAnalogVideoInputParams
WmiMonitorID
WmiMonitorBrightnessMethods
WmiMonitorBasicDisplayParams
WmiMonitorColorCharacteristics
WmiMonitorDescriptorMethods
WmiMonitorListedSupportedSourceM…
WmiMonitorBrightness
WmiMonitorColorXYZinCIE
WmiMonitorSupportedDisplayFeatures

 

WmiMonitorBasicDisplayParams   seems like a good place to start

Get-WmiObject -Namespace root\wmi -Class WmiMonitorBasicDisplayParams

produces

Active                        : True
DisplayTransferCharacteristic : 120
InstanceName                  : DISPLAY\LGD6301\5&21e3487a&0&UID33554704_0
MaxHorizontalImageSize        : 34
MaxVerticalImageSize          : 19
SupportedDisplayFeatures      : System.Management.ManagementBaseObject
VideoInputType                : 1

 

The supporteddisplayfeatures we need to dig into a bit

$monitor = Get-WmiObject -Namespace root\wmi -Class WmiMonitorBasicDisplayParams
$monitor.SupportedDisplayFeatures

ActiveOffSupported     : False
DisplayType            : 1
GTFSupported           : False
HasPreferredTimingMode : True
sRGBSupported          : False
StandbySupported       : False
SuspendSupported       : False

 

For interest sake the screen resolution of this monitor is 1366 x 768

We can calculate the approximate monitor size – which is the diagonal size – the max horizontal and vertical image sizes are truncated to the nearest centimeter. I think in inches so I want to convert

function get-monitorsize {
Get-WmiObject -Namespace root\wmi -Class WmiMonitorBasicDisplayParams |
select  @{N="Computer"; E={$_.__SERVER}},
InstanceName,
@{N="Horizonal"; E={[System.Math]::Round(($_.MaxHorizontalImageSize/2.54), 2)}},
@{N="Vertical"; E={[System.Math]::Round(($_.MaxVerticalImageSize/2.54), 2)}},
@{N="Size";
E={[System.Math]::Round(([System.Math]::Sqrt([System.Math]::Pow($_.MaxHorizontalImageSize, 2) `
+ [System.Math]::Pow($_.MaxVerticalImageSize, 2))/2.54),2)}}
}

A little bit of pythagoras theorem and division by 2.54 gives me results I can understand.

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: