Get real screen resolution on remote computers

Hello everyone,
I am looking for some command or some utility to get,
the screen resolution of remote Windows 10 computers,
which can have one or two different screens.
Well, I used: “[System.Windows.Forms.Screen]::AllScreens”.
But this statement only works in an interactive session
with a user with administrator permissions,
but not with remote commands.
Well, with remote commands, we always get the same resolution,
which corresponds to the virtual session that is created
to execute the remote commands.
I have also used the WMI-Object, the results are also similar,
although this time,
It usually gives the maximum resolution that the equipment can give.
And my problem is that I need to know
what resolution the equipment uses to determine the problems
that arise with certain applications, and correct them.
For this reason, you would also need to know how to modify
the screen resolutions of remote computers with win10,
without the need to connect with remote desktop.
Thanks for your help.

Instead of “screen” resolution you may search for “monitor” or “display”. … something like this:


I think the tricky part is to run it on remote computers, but I have found some PowerShell code that can get then info about screen resolution. See below. If you can run it in a scriptBlock with invoke-command or maybe create a script and execute it locally on remote computers. Maybe in a loginscript or something like that.

Add-Type -AssemblyName System.Windows.Forms
$screen_cnt  = [System.Windows.Forms.Screen]::AllScreens.Count
$col_screens = []::AllScreens

$info_screens = ($col_screens | ForEach-Object {
if ("$($_.Primary)" -eq "True") {$monitor_type = "Primary Monitor    "} else {$monitor_type = "Secondary Monitor  "}
if ("$($_.Bounds.Width)" -gt "$($_.Bounds.Height)") {$monitor_orientation = "Landscape"} else {$monitor_orientation = "Portrait"}
$monitor_type + "(Bounds)                          " + "$($_.Bounds)"
$monitor_type + "(Device Name)                     " + "$($_.DeviceName)"
$monitor_type + "(Bounds Width x Bounds Height)    " + "$($_.Bounds.Width) x $($_.Bounds.Height) ($monitor_orientation)"

Write-Host "TOTAL SCREEN COUNT: $screen_cnt"

Did you actually read the question? :smirk:

I don’t believe it is possible to query a computer remotely for screen resolution. Screen resolution is a user setting on the local computer. You can have multiple users logging in to the same computer, but use different screen resolution.

I think you need to execute the code for this locally in the users context and find a way to grab the result.

How many computers do you need to collect data from?
What kind of apps are you troubleshooting on?

But you can query the monitor for its resolution. :wink:

Yes, locally, but not on a remote computer.

Of course. Why do you think there’s a difference? :pinched_fingers:t3: :wink:

@Olaf why don’t you try to help resolving the issue insted of commenting on my suggestions?

Because I already did. If you skim through the search hits of the google search I linked above you will find more than one solution. :man_shrugging:t3:

$CimSession = New-CimSession -ComputerName 'ComputerName'
Get-CimInstance -ClassName Win32_VideoController -CimSession $CimSession | 
    Select-Object -Property *resolution*