How to Find Monitor Size for a Local or Remote PC

Adam Bertram

Adam Bertram

Read more posts by this author.

Here’s a pretty cool script that will get you the monitor size for a local or remote device via WMI. If will work with both single monitor devices as well as multiple monitors.

param($ComputerName = 'localhost')

$output = [PSCustomObject]@{
    ComputerName = $ComputerName
    MonitorSizes = ''

$oWmi = Get-WmiObject -Namespace 'root\wmi' -ComputerName $ComputerName -Query "SELECT MaxHorizontalImageSize,MaxVerticalImageSize FROM WmiMonitorBasicDisplayParams"

$sizes = @()
if ($oWmi.Count -gt 1) {
    foreach ($i in $oWmi) {
        $x = [System.Math]::Pow($i.MaxHorizontalImageSize/2.54,2)
        $y = [System.Math]::Pow($i.MaxVerticalImageSize/2.54,2)
        $sizes += [System.Math]::Round([System.Math]::Sqrt($x + $y),0)
} else {
    $x = [System.Math]::Pow($oWmi.MaxHorizontalImageSize/2.54,2)
    $y = [System.Math]::Pow($oWmi.MaxVerticalImageSize/2.54,2)
    $sizes += [System.Math]::Round([System.Math]::Sqrt($x + $y),0)
$output.MonitorSizes = $sizes

Subscribe to Adam the Automator

Get the latest posts delivered right to your inbox

Looks like you're offline!