Asked by:
How to alter a printer driver's default settings in a Windows 2008R2 RDS environment with RDS printer mappings
-
Hello Technet-forum,
We have an annoying but persistent printing issue in our Remote Desktop Environment. Our setup is as follows:
We have a Windows 2008r2 Remote Desktop Services farm, to which we connect with Wyse ThinOS thin clients. Some of our thin clients have a USB printer attached, most of them being a Dymo LabelWriter 400/450 Turbo. Printing to the printers from the RDS-servers is done via a printer mapping; If we install a driver on the rds-server with the exact name of the USB identifier of the printer attached to the thin client, and we connect from the thin client to the server, Windows will make a new printer in our session, called "<name of printer> (xx omgeleid)", with xx being the number of our Remote Desktop-session.
Now this works reasonably, with one exception: as there is a new printer created everytime we start a session, we cannot save printing preferences for that printer. So we need to reset our paper size and orientation every time we attach to our session. This is prohibitive, even more so because the application that is mostly used saves printing preferences itself in a per-user-per-printer-per-task fashion, forcing users to set paper size and orientation multiple times every day. To solve this, I would like new printers created with the dymo drivers to have a different default paper size and orientation than the driver's default.
To do so, I took the dymo drivers, and edited the .gpd for our label printer, setting the DefaultOption's for orientation and paper size to our desired default setting, incremented the version number, and installed the resulting driver (This obviously complains about the driver not being signed since we changed the driver, but installation and printing afterwards is succesful). However, our default setting for the paper size is not working, and I'm wondering why.
Some more info: If we look in the registry in HKLM\SYSTEM\CurrentControlSet\Control\Print\Printers\<printername> and look into the Default DevMode key, it's clear that that devmode contains the papersize we want, and the orientation we want. My conclusion from that is that our modification of the .gpd was succesful.
The weird thing is, if I go into printing preferences for this printer, and apply the settings, it will create a devmode (in HKCU\Printers\DevModesPerUser|DevModes2) with a different papersize. In other words, I didn't change a setting, but the devmode saved in HKCU is different from the default devmode set for the printer.Now my theory is that either the Default Devmode is somehow invalid, and the driver decides to generate a new devmode as a result, or, this driver simple doesn't honour the Default Devmode at all, and simply creates a new devmode from something hardcoded regardless of what is in the default devmode key.
Now for my questions:
1. Is it possible to increase verbosity of what a printerdriver is doing, in order to determine why the default devmode in the registry is not being taken as the default.
2. If that is not possible, or the problem is hardcoded into the driver binaries: Can I somehow automatically run a script every time windows creates a new printer, so I can set the paper size and orientation for the printer automatically on printer creation.
Thanks in advance,
--
Rien Broekstra
Question
All replies
-
-
Have you gotten this to work?
we have the same problem
we have almost found a solution, but it fails sometimes.
we run a VBS script at login that will find the correct redirected printer by its driver name and then use the printer name to import registy settings in the correct registy path.
but it fails sometimes - it looks like a timings issue its import the settings before redirected printer is ready.

