A 30 Seconds to 5 Minutes Logon Delay for Users when Launching XenApp Published Apps

A 30 Seconds to 5 Minutes Logon Delay for Users when Launching XenApp Published Apps

book

Article ID: CTX139212

calendar_today

Updated On:

Description

There is a 30 seconds to 5 minutes logon delay for some users when launching XenApp published apps.

Environment

The above mentioned sample code is provided to you as is with no representations, warranties or conditions of any kind. You may use, modify and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the sample code may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the sample code fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the sample code. In no event should the code be used to support ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright in the code belongs to Citrix, any distribution of the sample code should include only your own standard copyright attribution, and not that of Citrix. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the sample code.

Resolution

Following is CDF traces taken on the XenApp server while reproducing the issue. According to the CDF trace, 726 printers were being mapped in the session: 

Checking DriverMappingList policy for Driver " HP LaserJet P2015 Series PCL 6".    
609364 \src\ntsys\print\cpsvc\svccore    668    5356   26/07/2013 07:56:53.393    CSessionDbg.cpp       CSession::SessionCdfTraceExit     93     CDF_ENTRY     =======>>> SESSION EXIT in CSession::CreateClientPrinter :: Prt Cnt = 723, Policies = 104710, Session = 4, UID = pmedrano, Log Count = 4, m_pIcaName = AL07P100019 :: SUCCESS
609366 \src\ntsys\print\cpsvc\svccore    668    5356   26/07/2013 07:56:53.393    CSessionDbg.cpp       CSession::SessionCdfTraceExit     93     CDF_ENTRY     =======>>> SESSION EXIT in CSession::CreateClientPrinterByName :: Prt Cnt = 723, Policies = 104710, Session = 4, UID = pmedrano, Log Count = 4, m_pIcaName = AL07P100019 :: SUCCESS 
609377 \src\ntsys\print\cpsvc\svccore    668    5356   26/07/2013 07:56:53.394    CSessionDbg.cpp       CSession::SessionCdfTraceExit     93     CDF_ENTRY     =======>>> SESSION EXIT in CSession::GetAutoClientPrinterInfo :: Prt Cnt = 723, Policies = 104710, Session = 4, UID = pmedrano, Log Count = 4, m_pIcaName = AL07P100019 :: SUCCESS 
609386 \src\ica\Printing\cpsvc\svccore   668    5356   26/07/2013 07:56:53.394    CSessionPrinter.cpp       CSessionPrinter::CreateClientPrinterUsingPolicies      973    CDF_INFO       CSessionPrinter::CreateClientPrinterUsingPolicies: Checking DriverMappingList policy for Driver " HP LaserJet P2015 Series PCL 6".    
610340 \src\ntsys\print\cpsvc\svccore    668    5356   26/07/2013 07:56:53.574    CSessionDbg.cpp       CSession::SessionCdfTraceExit     93     CDF_ENTRY     =======>>> SESSION EXIT in CSession::CreateClientPrinter :: Prt Cnt = 724, Policies = 104710, Session = 4, UID = pmedrano, Log Count = 4, m_pIcaName = AL07P100019 :: SUCCESS
610342 \src\ntsys\print\cpsvc\svccore    668    5356   26/07/2013 07:56:53.574    CSessionDbg.cpp       CSession::SessionCdfTraceExit     93     CDF_ENTRY     =======>>> SESSION EXIT in CSession::CreateClientPrinterByName :: Prt Cnt = 724, Policies = 104710, Session = 4, UID = pmedrano, Log Count = 4, m_pIcaName = AL07P100019 :: SUCCESS 
610353 \src\ntsys\print\cpsvc\svccore    668    5356   26/07/2013 07:56:53.575    CSessionDbg.cpp       CSession::SessionCdfTraceExit     93     CDF_ENTRY     =======>>> SESSION EXIT in CSession::GetAutoClientPrinterInfo :: Prt Cnt = 724, Policies = 104710, Session = 4, UID = pmedrano, Log Count = 4, m_pIcaName = AL07P100019 :: SUCCESS 
610362 \src\ica\Printing\cpsvc\svccore   668    5356   26/07/2013 07:56:53.575    CSessionPrinter.cpp       CSessionPrinter::CreateClientPrinterUsingPolicies      973    CDF_INFO       CSessionPrinter::CreateClientPrinterUsingPolicies: Checking DriverMappingList policy for Driver " HP LaserJet P2015 Series PCL 6".    
611316 \src\ntsys\print\cpsvc\svccore    668    5356   26/07/2013 07:56:53.767    CSessionDbg.cpp       CSession::SessionCdfTraceExit     93     CDF_ENTRY     =======>>> SESSION EXIT in CSession::CreateClientPrinter :: Prt Cnt = 725, Policies = 104710, Session = 4, UID = pmedrano, Log Count = 4, m_pIcaName = AL07P100019 :: SUCCESS
611318 \src\ntsys\print\cpsvc\svccore    668    5356   26/07/2013 07:56:53.767    CSessionDbg.cpp       CSession::SessionCdfTraceExit     93     CDF_ENTRY     =======>>> SESSION EXIT in CSession::CreateClientPrinterByName :: Prt Cnt = 725, Policies = 104710, Session = 4, UID = pmedrano, Log Count = 4, m_pIcaName = AL07P100019 :: SUCCESS 
611329 \src\ntsys\print\cpsvc\svccore    668    5356   26/07/2013 07:56:53.767    CSessionDbg.cpp       CSession::SessionCdfTraceExit     93     CDF_ENTRY     =======>>> SESSION EXIT in CSession::GetAutoClientPrinterInfo :: Prt Cnt = 725, Policies = 104710, Session = 4, UID = pmedrano, Log Count = 4, m_pIcaName = AL07P100019 :: SUCCESS 
611338 \src\ica\Printing\cpsvc\svccore   668    5356   26/07/2013 07:56:53.768    CSessionPrinter.cpp       CSessionPrinter::CreateClientPrinterUsingPolicies      973    CDF_INFO       CSessionPrinter::CreateClientPrinterUsingPolicies: Checking DriverMappingList policy for Driver " HP LaserJet P2015 Series PCL 6".    
612292 \src\ntsys\print\cpsvc\svccore    668    5356   26/07/2013 07:56:53.966    CSessionDbg.cpp       CSession::SessionCdfTraceExit     93     CDF_ENTRY     =======>>> SESSION EXIT in CSession::CreateClientPrinter :: Prt Cnt = 726, Policies = 104710, Session = 4, UID = pmedrano, Log Count = 4, m_pIcaName = AL07P100019 :: SUCCESS
612294 \src\ntsys\print\cpsvc\svccore    668    5356   26/07/2013 07:56:53.966    CSessionDbg.cpp       CSession::SessionCdfTraceExit     93     CDF_ENTRY     =======>>> SESSION EXIT in CSession::CreateClientPrinterByName :: Prt Cnt = 726, Policies = 104710, Session = 4, UID = pmedrano, Log Count = 4, m_pIcaName = AL07P100019 :: SUCCESS 
612305 \src\ntsys\print\cpsvc\svccore    668    5356   26/07/2013 07:56:53.966    CSessionDbg.cpp       CSession::SessionCdfTraceExit     93     CDF_ENTRY     =======>>> SESSION EXIT in CSession::GetAutoClientPrinterInfo :: Prt Cnt = 726, Policies = 104710, Session = 4, UID = pmedrano, Log Count = 4, m_pIcaName = AL07P100019 :: SUCCESS 
612314 \src\ica\Printing\cpsvc\svccore   668    5356   26/07/2013
 

Looking for the DriverMappingList key in Process Monitor showed that CpSvc.exe is querying it many times: 
DriverMappingList key in Process Monitor

It matches process PID (CpSvc) that queries this value. Also the time it takes (two tries each) 7:56:53.768 for example
There are 1692 occurrences of this during the entire printer mapping (app start) in ProcMon:
1692 occurrences

There are only 6 printers installed locally on the client machine. However, something on the server side or client side makes the server think that there many printers mapped on the client.
 
First tried to delete the server profile, but with a new server profile also the behavior was the same. Then the client machine profile was investigated and found that under the following registry key there many printer properties (some outdated):
HKEY_CURRENT_USER\Software\Citrix\PrinterProperties

Resolution

Delete the registry key from the client side to change the logon time from 5 minutes to 15 seconds. Customer applied a logon script for the client machine that deletes that registry key during the user logon.

Issue/Introduction

This article is a case study of the 30 Seconds to 5 Minutes Logon Delay for Users when Launching XenApp Published Apps.