Session printer not being deleted when Workspace Control takes place

Session printer not being deleted when Workspace Control takes place

book

Article ID: CTX226539

calendar_today

Updated On:

Description

  1. Create network printers on your Windows Server like below
    User-added image
  2. Configure the Citrix Policy "Printer assignments" assigning printer to specific client like below.
    - Printer_A for Client_A
    - Printer_B for Client_B
    User-added image
  3. Start published desktop from Client_A
  4. You see Printer_A only
  5. Start published desktop from Client_B (session roaming)
  6. You see both Printer_A and Printer_B
Expected behavior: Printer_A should be deleted when connected from Client_B
Actual behavior: Printer_A is not deleted in case of session roaming
NOTE: 
  • The issue is reproducible with Non-UPS printers on Server VDA 7.9, 7.11, 7.12, 7.13, 7.14 and 7.15.
  • The issue caused by LC8077 is not reproducible on Desktop VDA or Server VDA 7.6, 7.7 or 7.8.
  • The issue of problem cause #2 is reproducible on any environments.
  • The issue is not reproducible with UPS printers.

Resolution

The fix for LC8077 has been released with 7.15 LTSR CU1 and 7.16.
NOTE: There are 2 different problem causes. The fix for LC8077 resolves the problem cause #1 only.
 

Problem Cause

There are 2 problem cause:
  1. Basically, VDA creates session printers by calling AddPrinterConnection function, and deletes created printers by calling DeletePrinterConnection function. Based on these function calls, Windows Print Spooler service creates or deletes network printers. However, since Server VDA 7.9, VDA no longer calls DeletePrinterConnection during session roaming. As result, session printers are not deleted by Print Spooler service. This is an issue resolved by the fix for LC8077.
  2. Even if the fix for LC8077 is applied properly and DeletePrinterConnection is called successfully, we found that Print Spooler service randomly re-creates deleted printers, unexpectedly. ​It is reproducible in RDP sessions and we see such strange behavior in Windows Server 2008R2, 2012R2 and 2016 even if Server VDA is not installed. Please note that it is not our defect, and should be investigated by Microsoft. (To reproduce the issue, we created a sample application which call Windows APIs (OpenPrinter, AddPrinterConnection, DeletePrinterConnection). If the sample application calls DeletePrinterConnection when WTS_REMOTE_CONNECT event is signaled, the network printer is basically deleted when session is re-connected, but such deleted printer is sometimes re-created later, unexpectedly.)

Issue/Introduction

Session printer not being deleted when Workspace Control takes place