One of my clients asked me to change all the workstations resolution to 1024X768 due to a new application that was inserted to the users.
I looked for a solution, which at the time looked like some GPO setting. After a long search I realized that not only that it cannot be done via GPO, but that for it to succeed, the user must be logged in and not locked for the process of changing the resolution.
A good thing to do before this is to lock the user option to change his resolution back. You can do this by using GPO settings: User Settings -> Policies (in Vista/2008) -> Administrative Templates -> Control Panel -> Display.
Another thing I found out is that the display driver adds to the right-click of the desktop a link to the driver control panel, where the users can change the settings regardless of the previous GPO restrictions. Fix it by removing the keys under HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\
- NvCplDesktopContext for Nvidia
- Igfxcui for Intel
After I made sure the users could not undo my changes I looked for ward to change the resolution. I found a cool small utility named ResSwitch that does exactly this.
Next I needed to make sure that the user GUI is loaded because if not, the resolution change will not happen. I managed to do this with a loop in a batch file that looks for the explorer.exe process to load:
If you think I was over, you are wrong…, the screen resolution could not be done if the user is in a locked state.
Here I really got lost, it seems that you cannot tell if the user is in a locked state because all the processes are running and even SCCM thinks that the user is logged in so it tries to run the job.
My guys at Smart-x wrote me a small tool named CheckIfLocked that checks if the user is locked and gives me back an error level, so the second part of the batch file looks like this:
:check_if_locked
CheckIfLocked.exe
if %errorlevel% == 0 (goto next) else (goto check_if_locked)
:next
Finally, changing the screen resolution:
"%~dp0ResSwitch.exe" /WIDTH:1024 /HEIGHT:768
I’m happy to inform you that now all the workstations have the same screen resolution. Make sure you inform the users of this change before you do it… J