There is a 30 seconds to 5 minutes logon delay for some users when launching XenApp published apps.
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:
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:
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
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.