Hi,
I'm trying to figure out how to determine how many and what size monitors are connected to a computer running remotely at home, preferably using PowerShell at this moment. Following a Hey Scripting Guys blog post I've hit upon two approaches using wim32, wim32_VideoController and Wim32_DesktopMonitor. These are nice but they don't list all monitors on a system. Almost all of my users have two monitors at home.
Here's the simple script I'm using:
Get-WmiObject -Class "win32_videocontroller" -Namespace "root\CIMV2" -ComputerName $CompName
Get-WmiObject -Class "win32_desktopmonitor" -ComputerName $CompName
I can deduce the size of the monitor from the screen height/width or horizontal/vertical resolution depending which win32 class I am running.
My problem is that it is only returning information on 1 of the 2 monitors.
Any thoughts on how to get it to return all of the monitors attached to the system? Or, is there a better way to get this information that I haven't seen yet?
Thanks in advance!