tri_94 Posted July 22, 2020 Posted July 22, 2020 Hi there can anyone help me with a powershell command that get retrieve screen res for multiple monitors I was using "(Get-WmiObject -ComputerName $Computer win32_videocontroller | Select-Object VideoModeDescription).VideoModeDescription)" However it only returns one. I've looked at [system.windows.forms.screen]::AllScreens but from what i understand can't use this remotely. I've looked at Get-CimInstance -ClassName CIM_VideoController and that only seems to give me one as well. Thanks
Steve21 Posted July 22, 2020 Posted July 22, 2020 I think the way you're doing it on the first won't loop over both, but using search on the caption/res might: Get-WmiObject -ComputerName $Computer win32_videocontroller | select caption, CurrentHorizontalResolution, CurrentVerticalResolution Or if you're happy with the last one you mentioned baove, try: Get-CimInstance -Namespace root\wmi -ClassName WmiMonitorBasicDisplayParams But that'll return whole lot rather than just the lines you want Steve
tri_94 Posted July 22, 2020 Author Posted July 22, 2020 Thanks for that i've just tried both and no luck Get-WmiObject -ComputerName $Computer win32_videocontroller | select caption, CurrentHorizontalResolution, CurrentVerticalResolution [/Code] When i try that it just returns caption CurrentHorizontalResolution CurrentVerticalResolution ------- --------------------------- ------------------------- Intel® UHD Graphics 630 1920 1080 i have two monitors on my test machine one at 1920 x 1680 and the other i've set to 1400 x 1050. The Get-CimInstance Returns Active : True DisplayTransferCharacteristic : 120 InstanceName : DISPLAY\DEL4077\4&eeeeeeeeeeeeexxx MaxHorizontalImageSize : 51 MaxVerticalImageSize : 29 SupportedDisplayFeatures : WmiMonitorSupportedDisplayFeatures VideoInputType : 1 PSComputerName : Active : True DisplayTransferCharacteristic : 120 InstanceName : DISPLAY\DEL4076\4&eeeeeeeeeeeeexxx MaxHorizontalImageSize : 51 MaxVerticalImageSize : 29 SupportedDisplayFeatures : WmiMonitorSupportedDisplayFeatures VideoInputType : 1 PSComputerName : I'd perfer to try and use Get-WmiObject if possible. Thanks
Steve21 Posted July 22, 2020 Posted July 22, 2020 Thanks for that i've just tried both and no luck Get-WmiObject -ComputerName $Computer win32_videocontroller | select caption, CurrentHorizontalResolution, CurrentVerticalResolution [/Code] When i try that it just returns caption CurrentHorizontalResolution CurrentVerticalResolution ------- --------------------------- ------------------------- Intel® UHD Graphics 630 1920 1080 i have two monitors on my test machine one at 1920 x 1680 and the other i've set to 1400 x 1050. If you run Get-WmiObject win32_videocontroller manually on your machine, do both show up as separate displays with the same name? (caption etc), or does it only return one in the full list? Just thinking it might show different if it's 1 card with 2 monitors, or 2 cards with 1 mon each Steve
tri_94 Posted July 22, 2020 Author Posted July 22, 2020 It only shows one __RELPATH : Win32_VideoController.DeviceID="VideoController1" ..... DeviceID : VideoController1 VideoModeDescription : 1920 x 1080 x 4294967296 colors Both Monitors are plugged into the onboard graphics which is the Intel Graphics UHD 630. Didn't know if the VideoController1 is relevant or not?
tri_94 Posted July 22, 2020 Author Posted July 22, 2020 When I use Win32_MonitorDetails it sees both monitors returns the model numbers fine. (((Get-WmiObject Win32_MonitorDetails -ComputerName $ComputerName -ErrorAction SilentlyContinue | Select-Object -Property Model).Model) -join ", ")
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now