XenApp Session Printers: Allow Users to Change their Default Printer

So we don’t normally like to give users options or choices…and right clicking is also normally not allowed in XenApp sessions. At some point in XenApp 6.0 (give or take) the printing system changed such that logoff scripts could no longer see what the users’ default session printer was because they had already been unloaded by the logoff process. So how do we make this work? The logoff script is out, so we now have to find another way to maintain the default printer that the user chose. How?

Give them a simple HTA to choose their default printer. 

This does 2 things: allows us to keep track of their default printer choice (and gives users the illusion of “choice”) and also turn off the default explorer context menu. Here’s a simple HTA that saves a printer.default text file in AppData\Roaming\Persist:

By default, Citrix UPM will pick up this file unless you are excluding Roaming for some reason – just add an inclusion (synchronization) if needed.

Next, you’ll need a logon script to read this file and set the default printer. Here’s a VBS to do just that:

The script can be adjusted for the timeout needed on mapping session printers. If you using the Citrix UPS or something like ThinPrint, 20 seconds should be more than enough. Otherwise, you can bump it up to say 40 seconds or so (40000).

Leave a Reply