Mapping any RDP printer in Terminal Services w/ REDMON

I have always felt that RDP printer mapping within Windows Terminal Services has been much more difficult than it should be. Especially since articles I have read from Microsoft and other sources in the past do not recommend using ANY third party printer drivers on your terminal server. These articles claim that third party printer drivers are the #1 cause for blue screen situations on a terminal server. As a result, I would often try to find a “compatible” driver in the existing Windows printer list. Sometimes I simply could not get a printer to work within a terminal server session.

This article demonstrates how to map ANY working client printer within a terminal server session. Although I would still recommend settling on a compatible driver when possible (ie: Use “HP LaserJet 1100” driver on both ends if you have an LJ 1200), this method allows black and white (and possibly color) printing on any working client printer from within an RDP session.

Setup the printer on the client and confirm it is working by printing a test page. This article assumes the printer is working properly on the client computer. You can use any driver you need to at this point. The driver does not need to be supported by Windows Terminal Server!

We are going to setup a generic postscript printer on the client that accepts jobs and then prints them to the desired destination printer using a combination of RedMon, Ghostscript, and GSview. Once this is working, we can easily configure the terminal server to recognize this postscript printer.

Download and install the most recent version of AFPL Ghostscript and GSview available for your client computer. Make note of the installation directory you use for GSview (usually c:\program files\ghostgum\gsview\gsprint.exe). The default install options are sufficient. At the time of this article, I used AFPL Ghostscript 8.54 Win32 and GSview 4.8 Win32 on a Windows XP SP2 client.

Download and install the most recent version of RedMon – Redirection Port Monitor. This will add a “Redirected Port” to the list of port types you see when you try to add a new printer port to your computer. No install options are presented when you run SETUP.EXE. At the time of this article, I used RedMon 1.7 Win32 on a Windows XP SP2 client.

Create a new printer on the Windows client. After you click “Add a Printer”, choose “Local Printer” (do not auto detect), then choose “Create a new port” (type of port: Redirected Port, port name: use the default), then choose the “Apple LaserWriter II NT v47.0” printer driver, then name the printer “Terminal Services Printer”. Do not make this your default printer. Do not print a test page (yet).

Now we need to install the same driver to your server. We will create an identical printer (on a fake/unused port) and then remove the printer. You may be asked if you want to remove the printer drivers from the terminal server. Be sure to answer NO, because we will need to keep the drivers! Once these drivers are available on the terminal server, automatic printer mapping can occur for any client that is using the exact same driver.

Create a new printer on the Windows Terminal Server. Use the same method and same driver as described for the Windows client (above). It is extremely important that the driver shown in the “Advanced” printer properties tab is IDENTICAL on the client and server, otherwise automatic printer mapping will not occur. If the LaserWriter driver mentioned above is not available on both systems, find/use another common PostScript driver that is available on both systems.

Now that your generic postscript printer has been created on the client and on the server, we need to configure the Redirected Port on the Windows client. Open the properties window for this new printer, then click “Configure Port” on the Ports tab. Redirect this port to the program gsprint.exe (located in c:\program files\ghostgum\gsview\gsprint.exe). Arguments for this program should be simlar to the following example. The printer name provided must EXACTLY match the name of the destination printer! Very important! The “-color” parameter would allow color printing in this particular example (assuming the printer was capable of printing in color). And the final dash “-” is REQUIRED or else the postscript data will not be received by gsprint.exe.

-printer “HP DeskJet 720C Series” -color –

The default settings for the other options will usually work fine. The “Output” default setting should be “Program handles output”. The “Printer” setting is unused/unavailable in this configuration. As a personal preference, I change the “Run” option from NORMAL to HIDDEN so that the GhostScript window does not appear. I also enable the “Run as User” option so that I am prompted for a filename if I send jobs to my local PDF writer. The shutdown delay could be increased from 300 seconds if you find that it takes more than five minutes for your computer to redirect an incoming job to the destination printer.

At this point, you should be able to print a test page through this new postscript printer. The test page should be redirected to your destination printer driver and successfully printed on your printer. If it is not, review your settings and/or review instructions for Emulating a PostScript printer on a Windows host. This article is partially based on instructions from that page.

Attempt to login to the Windows Terminal Server with your RDP client. If the local postscript printer does not appear (pre-Windows 2003 client?), the local RDP client is preventing redirection because it does not recognize the port type. You can resolve this problem by forcing the client to redirect all ports. You should add a DWORD value named “FilterQueueType” with value “FFFFFFFF” to “HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Default\AddIns\RDPDR”. Refer to Microsoft Knowledgebase Article # Q302361 for more information regarding this configuration update.

2006/07/20 – Jason Klein