Jump to content

Recommended Posts

Posted

Hello,

 

Does anyone know if its possible to set an item-level targeting in group policy preferences based on the screen resolution of the client please?

 

Thanks

Posted
Must be possible by identifying resolution in registry

 

only other option would be by using wmi as far as i can see

  • Thanks 1
Posted
I am trying to move away from the script, thats why I want to try GPP. If you don't modify the default profile the wallpaper isn't set the first time you logon. If you modify the default profile in Windows 10 search breaks.
Posted (edited)

There is a WMI object which may report your screen's resolution: Win32_DesktopMonitor

 

Powershell Command:

 Get-CIMInstance Win32_DesktopMonitor | select *

 

Output:

 

DeviceID                    : DesktopMonitor1
Name                        : Dell P2414H(DisplayPort)
PixelsPerXLogicalInch       : 96
PixelsPerYLogicalInch       : 96
ScreenHeight                :
ScreenWidth                 :
IsLocked                    :
LastErrorCode               :
Status                      : OK
StatusInfo                  :
Caption                     : Dell P2414H(DisplayPort)
Description                 : Dell P2414H(DisplayPort)
InstallDate                 :
Availability                : 8
ConfigManagerErrorCode      : 0
ConfigManagerUserConfig     : False
CreationClassName           : Win32_DesktopMonitor
ErrorCleared                :
ErrorDescription            :
PNPDeviceID                 : DISPLAY\DELA09A\4&2CBCB734&1&UID200195
PowerManagementCapabilities :
PowerManagementSupported    :
SystemCreationClassName     : Win32_ComputerSystem
SystemName                  : N-ISLS-PC-A3
Bandwidth                   :
DisplayType                 :
MonitorManufacturer         : Dell Inc.
MonitorType                 : Dell P2414H(DisplayPort)
PSComputerName              :
CimClass                    : root/cimv2:Win32_DesktopMonitor
CimInstanceProperties       : {Caption, Description, InstallDate, Name...}
CimSystemProperties         : Microsoft.Management.Infrastructure.CimSystemProperties

 

As you can see, it doesn't for mine but I have used this object in the past to report on screen resolutions.

Edited by Norphy
Posted
Even with the REG LOAD/REG ADD/REG UNLOAD method? :confused:

 

If we are talking about the same thing, yes :(

 

There is a WMI object which may report your screen's resolution: Win32_DesktopMonitor

 

Powershell Command:

 Get-CIMInstance Win32_DesktopMonitor | select *

 

Output:

 

DeviceID                    : DesktopMonitor1
Name                        : Dell P2414H(DisplayPort)
PixelsPerXLogicalInch       : 96
PixelsPerYLogicalInch       : 96
ScreenHeight                :
ScreenWidth                 :
IsLocked                    :
LastErrorCode               :
Status                      : OK
StatusInfo                  :
Caption                     : Dell P2414H(DisplayPort)
Description                 : Dell P2414H(DisplayPort)
InstallDate                 :
Availability                : 8
ConfigManagerErrorCode      : 0
ConfigManagerUserConfig     : False
CreationClassName           : Win32_DesktopMonitor
ErrorCleared                :
ErrorDescription            :
PNPDeviceID                 : DISPLAY\DELA09A\4&2CBCB734&1&UID200195
PowerManagementCapabilities :
PowerManagementSupported    :
SystemCreationClassName     : Win32_ComputerSystem
SystemName                  : N-ISLS-PC-A3
Bandwidth                   :
DisplayType                 :
MonitorManufacturer         : Dell Inc.
MonitorType                 : Dell P2414H(DisplayPort)
PSComputerName              :
CimClass                    : root/cimv2:Win32_DesktopMonitor
CimInstanceProperties       : {Caption, Description, InstallDate, Name...}
CimSystemProperties         : Microsoft.Management.Infrastructure.CimSystemProperties

 

As you can see, it doesn't for mine but I have used this object in the past to report on screen resolutions.

 

Will give that a try. Thanks

Posted

Here's the output from a VM which has reported it:

 

DeviceID                    : DesktopMonitor1
Name                        : Generic Non-PnP Monitor
PixelsPerXLogicalInch       : 96
PixelsPerYLogicalInch       : 96
ScreenHeight                : 768
ScreenWidth                 : 1024
IsLocked                    :
LastErrorCode               :
Status                      : OK
StatusInfo                  :
Caption                     : Generic Non-PnP Monitor
Description                 : Generic Non-PnP Monitor
InstallDate                 :
Availability                : 3
ConfigManagerErrorCode      : 0
ConfigManagerUserConfig     : False
CreationClassName           : Win32_DesktopMonitor
ErrorCleared                :
ErrorDescription            :
PNPDeviceID                 : DISPLAY\DEFAULT_MONITOR\5&1A097CD8&0&UID1413764680
PowerManagementCapabilities :
PowerManagementSupported    :
SystemCreationClassName     : Win32_ComputerSystem
SystemName                  : CMTEST
Bandwidth                   :
DisplayType                 :
MonitorManufacturer         : (Standard monitor types)
MonitorType                 : Generic Non-PnP Monitor
PSComputerName              : cmtest
CimClass                    : root/cimv2:Win32_DesktopMonitor
CimInstanceProperties       : {Caption, Description, InstallDate, Name...}
CimSystemProperties         : Microsoft.Management.Infrastructure.CimSystemProperties

Posted

Something like

 

select * from win32_desktopmonitor where screenheight = 768 and screenwidth = 1024

 

Obviously change the height and width values to match what you're looking for.

Posted

in the past ive just either made a script that changes the res based on pc make / model as reading screen info from wmi is lets go with patchy ot just created pc groups (so 1024x768 1600x900 and so on) and adding pcs to the right group then just scripting out qres (copy it to c:\windows) and qres \x:1600 /y:900 /c:32 its definitely script based but it works im not entirely convinced you could use gpp to do it as though its a reg setting (i assume) just changing it probably wont switch the res until a reboot if then

 

and ive just reread you want to look up not change but i will leave this here in case its any use and qres/s>file would dump current screen res to a file which you could probably read/manipulate somehow

Posted (edited)

Looking further at it, I think the Win32_VideoController class would be more useful:

 

Powershell Command to see the class:

 

Get-CIMInstance Win32_VideoController

 

Output:

Caption                      : Intel(R) HD Graphics 4600
Description                  : Intel(R) HD Graphics 4600
InstallDate                  :
Name                         : Intel(R) HD Graphics 4600
Status                       : OK
Availability                 : 3
ConfigManagerErrorCode       : 0
ConfigManagerUserConfig      : False
CreationClassName            : Win32_VideoController
DeviceID                     : VideoController1
ErrorCleared                 :
ErrorDescription             :
LastErrorCode                :
PNPDeviceID                  : PCI\VEN_8086&DEV_0412&SUBSYS_05A41028&REV_06\3&11583659&0&10
PowerManagementCapabilities  :
PowerManagementSupported     :
StatusInfo                   :
SystemCreationClassName      : Win32_ComputerSystem
SystemName                   : N-ISLS-PC-A3
MaxNumberControlled          :
ProtocolSupported            :
TimeOfLastReset              :
AcceleratorCapabilities      :
CapabilityDescriptions       :
CurrentBitsPerPixel          : 32
CurrentHorizontalResolution  : 1920
CurrentNumberOfColors        : 4294967296
CurrentNumberOfColumns       : 0
CurrentNumberOfRows          : 0
CurrentRefreshRate           : 60
CurrentScanMode              : 4
CurrentVerticalResolution    : 1080
MaxMemorySupported           :
MaxRefreshRate               : 75
MinRefreshRate               : 59
NumberOfVideoPages           :
VideoMemoryType              : 2
VideoProcessor               : Intel(R) HD Graphics Family
NumberOfColorPlanes          :
VideoArchitecture            : 5
VideoMode                    :
AdapterCompatibility         : Intel Corporation
AdapterDACType               : Internal
AdapterRAM                   : 1073741824
ColorTableEntries            :
DeviceSpecificPens           :
DitherType                   : 0
DriverDate                   : 03/03/2016 00:00:00
DriverVersion                : 20.19.15.4404
ICMIntent                    :
ICMMethod                    :
InfFilename                  : oem39.inf
InfSection                   : iHSWD_w10
InstalledDisplayDrivers      : igdumdim64.dll,igd10iumd64.dll,igd10iumd64.dll,igd12umd64.dll,igdumdim32,igd10iumd32,igd
                              10iumd32,igd12umd32
Monochrome                   : False
ReservedSystemPaletteEntries :
SpecificationVersion         :
SystemPaletteEntries         :
VideoModeDescription         : 1920 x 1080 x 4294967296 colors
PSComputerName               :

 

WMI Query:

Select CurrentHorizontalResolution, CurrentVerticalResolution from  Win32_VideoController where CurrentVerticalResolution = 1080 and CurrentHorizontalResolution = 1920

@FN-GM, you use ConfigMgr, right? The inventory of a machine in ConfigMgr is basically a dump of the CIMV2 WMI namespace. The majority of the stuff in there can be queried using SQL-like WQL commands, if you can find it in there you'll find a matching WMI class to match. Download WMI Explorer from Codeplex to go exploring.

Edited by Norphy
  • Thanks 1
Posted

You've got the resolutions the wrong way around. Horizontal: 1024, Vertical: 768.

 

To test a WMI query, try running wbemtest (run it from a run prompt).

 

Press the connect button in the top right corner

Accept the defaults and press Connect

Press the Query button (Second row, third from the left)

Paste the query into the box

 

If the query is correct, the results box will look like this:

 

wbemtest.png

 

If not, it'll look like this:

 

wbemtest2.png

  • Thanks 1
Posted
You've got the resolutions the wrong way around. Horizontal: 1024, Vertical: 768.

 

To test a WMI query, try running wbemtest (run it from a run prompt).

 

Press the connect button in the top right corner

Accept the defaults and press Connect

Press the Query button (Second row, third from the left)

Paste the query into the box

 

If the query is correct, the results box will look like this:

 

[ATTACH=CONFIG]36774[/ATTACH]

 

If not, it'll look like this:

 

[ATTACH=CONFIG]36775[/ATTACH]

 

I was just testing, and you passed. Well done! :D

Posted

Got it working on first login each time.

 

I set a Group Policy preference to copy a .jpg file based on the screen resolution using the WMI above.

 

I then set this GP to point to the copied file. - Configuration\Administrative Templates\Desktop\Desktop\Desktop Wallaper.

 

Thanks to all that replied.

 

Thanks

Posted
Got it working on first login each time.

 

I set a Group Policy preference to copy a .jpg file based on the screen resolution using the WMI above.

 

I then set this GP to point to the copied file. - Configuration\Administrative Templates\Desktop\Desktop\Desktop Wallaper.

 

Thanks to all that replied.

 

Thanks

 

Well done, glad to have helped.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...