Labels

Thursday, August 14, 2008

Troubleshooting Windows Printing

While working with Windows client-server printing, at times I've had to troubleshoot what's happening beyond the 'oh that didn't work, let's try another driver' response.

I've tried to describe a few things in this post:

  1. An overview of the components responsible for printing from XP to a 2003 print server.
  2. Components that could contribute to problems, or at least provide angles of attack when troubleshooting
  3. All the (sometimes contractictory) Microsoft documents I've used to gather this information

Overview

This is my understanding of a standard print job from an XP client to a Windows Server 2003 print server, using:
- Excel as the client-side application
- The HP PCL6 Universal Printer Driver
- An x64 2003 print server, with an x86 XP client

  • XP ->
  • Excel Application ->
  • Graphics Device Interface (GDI) generates EMF ->
  • Client Print Driver renders the EMF ->
  • Client Spooler (winspool.drv) forwards EMF using RPC to the server ->
  • 2003 Server Spooler service (spoolsv.exe) determines correct driver to load and schedules job, API call to router ->
  • Print router (spoolss.dll) determines which provider to route the job (to the local print provider in this case) ->
  • Local Print Provider (localspl.dll) writes the job to a local Spool File (.spl) and Shadow File (.shd) ->
    1. Spool file (.spl) rendered using GDI -> UniDrv -> x64 HP UPD PCL6 Printer Driver -> GDI (driver loaded by spooler service)
    2. Shadow file (.shd) for adminsitrative job control
    3. Print Processor is polled for the job data type (to assist with reverse order, booklets etc). Default print processor (winprint.dll) used for HP UPD PCL6
  • Print Monitor ->
    1. Language Monitor provides bi-directional communication to receive feedback from the printer, using Printer Job Language (PJL)
    2. Remote Port Monitor (Standard TCP/IP Port Monitor) controls communication with the device

    Note that the above is a stand-alone 2003 server, in a 2003 MSCS clustered environment clusres.dll controls the print spooler resource and also has its finger in the pie.


    Troubleshooting Components

    Drivers

      1. PostScript
      2. PCL
        1. PCL5 vs PCLXL (PCL6)
        2. UniDrv.dll versions – the core Microsoft framework for non-PS/XPS printing
      3. For HP printers, HP Universal Driver vs Model specific driver

      Client

      1. Local printer driver versions
      2. Local unidrv.dll versions
      3. Application being printed from
      4. Page Setup within the application, especially for documents that may automatically re-size or use non-A4 paper.
      5. Workstation port/printer directly connected to the printer, rather than through the print server (using the HP UPD or whatever driver is failing through the print server)
      6. Print locally to file, and then copy the file to the printer, eg: copy test.prn \\server\printer - this bypasses any server-side actions, such as driver GDI or print processors
      7. Check that there are no differences when logged on as standard user compared to a local administrator

      Print Server

      1. 32-bit vs 64bit - if your print server is different architecture than your clients, have a test print server using the same architecture available to narrow the problem
      2. Cluster vs stand-alone server, if you're using an MSCS cluster, have a stand-alone print server available to narrow the problem
      3. Print Processor Used - winspool being part of localspl.dll, or a third-party print processor. I've seen problems with some HP print processors on x64 causing the spooler to crash
      4. Local unidrv.dll versions on both the client and server
      5. Local Printer driver versions on both the client and server
      6. Disabled Advanced printing features on the advanced tab of the printer
      7. Print directly to the printer on the advanced tab of the printer, rather than spooling through the server
      8. Check automatic configuration is working for the HP UPD printers (this relies on name resolution of the portname, and works better from the console of the print server if running x64)
      9. Print defaults such as duplex and collation
      10. Port Type – TCP ports either LPR (515), or RAW over 9100, depending on what the physical printer requires
      11. Port Configuration – LPR Byte counting (double-spooling) is a recommended setting if incomplete documents are being printed
      12. Check the Event log for successful print logs (Event ID 10), and note the byte count on multiple attempts at printing the same document. If the byte count is different for the same print job, the XP client is not sending through the same data each time and the print server has no chance. I have seen this happen with old various XP unidrv.dll versions.
      13. Set the print queue to hold print jobs, allowing copies of the SPL and SHD files to be taken, the PJL language commands in the SPL have useful information as such as the XP driver version used to generate the spool file
      14. Event 6161 errors occur on a cluster after a failed driver install/change to a printer. This does not seem to cause print jobs to fail (the error returned is 0 – error success), but I have seen this problem and it typically suggests an error in the GDI EMF part of the process

      Physical Printer

      1. Printer Personality type – Auto, PCL, or PCLXL
      2. Print defaults, such as whether Duplexing is on or off
      3. Firmware revisions

      Citrix

      1. Printer driver used – Citrix Universal or driver downloaded form client
      2. Presentation server version
      3. Different servers in the farm used for different connections
      References:

      From a Microsoft article on how network printing works, the first focuses on the client-side, the second on the server-side: How Network Printing Works:
      http://technet2.microsoft.com/WindowsServer/en/library/d58ce7b9-49cf-4f5e-95e9-1ade005c13e01033.mspx

      Upgrading the firmware with FTP:
      http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=bpj07129

      Download HP firmware:
      http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=bpj07429

      Printer personality:
      http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=c00018766&prodTypeId=18972&prodSeriesId=83436&locale=en_US

      UPD download v4.1:
      http://h20338.www2.hp.com/Hpsub/cache/342988-0-0-225-121.html

      Troubleshooting Event 6161 errors:
      http://technet2.microsoft.com/windowsserver2008/en/library/63a6432a-8d4d-47e7-a0b1-61ad2fe033b81033.mspx?mfr=true

      HOW TO: Programmatically Create a Printer and Printer Port by Using PrinterAdmin (Prnadmin.dll) with a Visual Basic Script in Microsoft Windows 2000
      http://technet2.microsoft.com/WindowsServer/en/library/f9aa2f5f-c66c-4474-be59-a684429f56c01033.mspx

      Print Services
      http://www.microsoft.com/windowsserver2003/technologies/print/default.mspx

      New command-line tools:
      http://technet2.microsoft.com/WindowsServer/en/library/4c475b4c-e5ee-444c-a730-ccb7a13e03b41033.mspx

      LPR versus RAW, RAW should be a good enough default, indicating the spooler does not modify the job as it passes the queue:
      http://technet2.microsoft.com/windowsserver/en/library/094f06f5-350d-4730-a283-2d131ae6e9af1033.mspx?mfr=true

      Creating and Configuring a Highly Available Print Server Under Microsoft Windows Server 2003 Using a Server Cluster
      http://www.microsoft.com/windowsserver2003/techinfo/overview/availableprinter.mspx

      Hp universal:
      http://h20000.www2.hp.com/bizsupport/TechSupport/ProductList.jsp?locale=en_US&taskId=135&prodTypeId=18972&prodSeriesId=503548

      Print Driver Setup: 64-bit Drivers and Platforms
      http://download.microsoft.com/download/5/D/6/5D6EAF2B-7DDF-476B-93DC-7CF0072878E6/multiplatform_INF.doc

      Printer Driver Setup and 64-bit Implications
      http://download.microsoft.com/download/f/0/5/f05a42ce-575b-4c60-82d6-208d3754b2d6/PrintDrv-Setup_64-bit.ppt

      FAQ for 64-bit Windows Hardware
      http://msdn2.microsoft.com/en-us/isv/bb190529.aspx

      Windows Point and Print Technical Overview
      http://download.microsoft.com/download/5/c/3/5c331f2d-3c1e-40b8-a2ec-0282c047d201/Pointandprint.doc

      HP document on MSCS clusters:
      http://h20338.www2.hp.com/Hpsub/downloads/HP_Drivers_in_Cluster_Environments.pdf

      The printer driver may not be updated on the client computers after you update the printer driver on a Windows Server 2003-based print server in a clustered environment
      http://support.microsoft.com/?id=888744

      HP Universal Print Driver For Windows Installation and Deployment Strategies (Based on Driver Version 3.0)
      http://h20000.www2.hp.com/bc/docs/support/SupportManual/c00954411/c00954411.pdf

      HP UPD FAQ
      http://h20000.www2.hp.com/bc/docs/support/SupportManual/c00858695/c00858695.pdf

      If HP printer, confirm the printer is supported by UPD:
      http://h20338.www2.hp.com/Hpsub/cache/344305-0-0-225-121.html

      Microsoft Word - UPD Active Directory Administrator Template Whitepaper.doc:
      http://h20000.www2.hp.com/bc/docs/support/SupportManual/c01034932/c01034932.pdf

      HP Color LaserJet printer prints only in grayscale or in black-and-white on your Windows 2000 SP4-based computer
      http://support.microsoft.com/kb/830490

      GPD files
      http://www.microsoft.com/whdc/archive/unidrv.mspx

      Installing a print processor
      http://msdn2.microsoft.com/en-us/library/ms802182.aspx

      Users cannot print after you install a service pack, update rollup, or printer hotfix on a server in Windows 2000 or in Windows Server 2003
      http://support.microsoft.com/kb/832219

      Event ID 9 — Print Queue Status
      http://technet2.microsoft.com/windowsserver2008/en/library/63cefbb6-03eb-42fc-b65d-8bf5d32af1b91033.mspx?mfr=true

      Windows Point and Print Technical Overview
      http://download.microsoft.com/download/5/c/3/5c331f2d-3c1e-40b8-a2ec-0282c047d201/Pointandprint.doc

      Printer driver versioning
      http://msdn2.microsoft.com/en-us/library/ms802210.aspx

      Unidrv Components
      http://msdn2.microsoft.com/en-us/library/ms801791.aspx

      SetPrinter Info
      http://msdn2.microsoft.com/en-us/library/ms535715(VS.85).aspx

      Debugging Printer Driver Components
      http://msdn2.microsoft.com/en-us/library/ms802162.aspx

      Print Service Product Operations Guide
      http://www.microsoft.com/technet/solutionaccelerators/cits/mo/winsrvmg/pspog/pspog5.mspx

      Common Printing Problems
      http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/prork/prdl_pif_zshs.mspx?mfr=true

      Local Print Provider
      http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/core/fnbe_prn_ycqq.mspx?mfr=true

      Setting print spooler options
      http://technet2.microsoft.com/windowsserver/en/library/b9e9cbfa-2db0-4fab-872f-65b9d73c6aa11033.mspx

      Installing Printer Ports
      http://technet2.microsoft.com/windowsserver/en/library/094f06f5-350d-4730-a283-2d131ae6e9af1033.mspx

      Network Printer Ports
      http://technet2.microsoft.com/windowsserver/en/library/290b7dc7-58ce-47a3-853b-8dd0ea5f4a621033.mspx?mfr=true

      Creating and Configuring a Highly Available Print Server Under
      http://download.microsoft.com/download/2/a/9/2a9c5a6b-472a-40b0-942f-3ba50240ccd9/ConfiguringAHighlyAvailablePrintServer.doc

      Using a Substitute Print Driver on x64 Systems
      http://www.microsoft.com/windowsserver2003/techinfo/overview/x64printdriver.mspx

      Printer Driver Setup and 64-bit Implications
      http://download.microsoft.com/download/f/0/5/f05a42ce-575b-4c60-82d6-208d3754b2d6/PrintDrv-Setup_64-bit.ppt

      FAQ for 64-bit Windows Hardware
      http://msdn2.microsoft.com/en-us/isv/bb190529.aspx

      Print Driver Setup: 64-bit Drivers and Platforms
      http://download.microsoft.com/download/5/D/6/5D6EAF2B-7DDF-476B-93DC-7CF0072878E6/multiplatform_INF.doc

      The printer driver may not be updated on the client computers after you update the printer driver on a Windows Server 2003-based print server in a clustered environment
      http://support.microsoft.com/?id=888744

      Printing - Architecture and Driver Support
      http://www.microsoft.com/whdc/device/print/default.mspx

      Windows 2000 and Windows Server 2003 Printing Architecture
      http://technet2.microsoft.com/WindowsServer/en/library/a8bfd078-2508-443b-9dc4-0a5fbd673f671033.mspx

      Wayne's World of IT (WWoIT), Copyright 2008 Wayne Martin.

      163 comments:


      All Posts

      printQueue AD objects for 2003 ClusterVirtualCenter Physical to VirtualVirtual 2003 MSCS Cluster in ESX VI3
      Finding duplicate DNS recordsCommand-line automation – Echo and macrosCommand-line automation – set
      Command-line automation - errorlevels and ifCommand-line automation - find and findstrBuilding blocks of command-line automation - FOR
      Useful PowerShell command-line operationsMSCS 2003 Cluster Virtual Server ComponentsServer-side process for simple file access
      OpsMgr 2007 performance script - VMware datastores...Enumerating URLs in Internet ExplorerNTLM Trusts between 2003 and NT4
      2003 Servers with Hibernation enabledReading Shortcuts with PowerShell and VBSModifying DLL Resources
      Automatically mapping printersSimple string encryption with PowerShellUseful NTFS and security command-line operations
      Useful Windows Printer command-line operationsUseful Windows MSCS Cluster command-line operation...Useful VMware ESX and VC command-line operations
      Useful general command-line operationsUseful DNS, DHCP and WINS command-line operationsUseful Active Directory command-line operations
      Useful command-linesCreating secedit templates with PowerShellFixing Permissions with NTFS intra-volume moves
      Converting filetime with vbs and PowerShellDifference between bat and cmdReplica Domain for Authentication
      Troubleshooting Windows PrintingRenaming a user account in ADOpsMgr 2007 Reports - Sorting, Filtering, Charting...
      WMIC XSL CSV output formattingEnumerating File Server ResourcesWMIC Custom Alias and Format
      AD site discoveryPassing Parameters between OpsMgr and SSRSAnalyzing Windows Kernel Dumps
      Process list with command-line argumentsOpsMgr 2007 Customized Reporting - SQL QueriesPreventing accidental NTFS data moves
      FSRM and NTFS Quotas in 2003 R2PowerShell Deleting NTFS Alternate Data StreamsNTFS links - reparse, symbolic, hard, junction
      IE Warnings when files are executedPowerShell Low-level keyboard hookCross-forest authentication and GP processing
      Deleting Invalid SMS 2003 Distribution PointsCross-forest authentication and site synchronizati...Determining AD attribute replication
      AD Security vs Distribution GroupsTroubleshooting cross-forest trust secure channels...RIS cross-domain access
      Large SMS Web Reports return Error 500Troubleshooting SMS 2003 MP and SLPRemotely determine physical memory
      VMware SDK with PowershellSpinning Excel Pie ChartPoke-Info PowerShell script
      Reading web content with PowerShellAutomated Cluster File Security and PurgingManaging printers at the command-line
      File System Filters and minifiltersOpsMgr 2007 SSRS Reports using SQL 2005 XMLAccess Based Enumeration in 2003 and MSCS
      Find VM snapshots in ESX/VCComparing MSCS/VMware/DFS File & PrintModifying Exchange mailbox permissions
      Nested 'for /f' catch-allPowerShell FindFirstFileW bypassing MAX_PATHRunning PowerSell Scripts from ASP.Net
      Binary <-> Hex String files with PowershellOpsMgr 2007 Current Performance InstancesImpersonating a user without passwords
      Running a process in the secure winlogon desktopShadow an XP Terminal Services sessionFind where a user is logged on from
      Active Directory _msdcs DNS zonesUnlocking XP/2003 without passwords2003 Cluster-enabled scheduled tasks
      Purging aged files from the filesystemFinding customised ADM templates in ADDomain local security groups for cross-forest secu...
      Account Management eventlog auditingVMware cluster/Virtual Center StatisticsRunning scheduled tasks as a non-administrator
      Audit Windows 2003 print server usageActive Directory DiagnosticsViewing NTFS information with nfi and diskedit
      Performance Tuning for 2003 File ServersChecking ESX/VC VMs for snapshotsShowing non-persistent devices in device manager
      Implementing an MSCS 2003 server clusterFinding users on a subnetWMI filter for subnet filtered Group Policy
      Testing DNS records for scavengingRefreshing Computer Account AD Group MembershipTesting Network Ports from Windows
      Using Recovery Console with RISPAE Boot.ini Switch for DEP or 4GB+ memoryUsing 32-bit COM objects on x64 platforms
      Active Directory Organizational Unit (OU) DesignTroubleshooting computer accounts in an Active Dir...260+ character MAX_PATH limitations in filenames
      Create or modify a security template for NTFS perm...Find where a user is connecting from through WMISDDL syntax in secedit security templates

      About Me

      I’ve worked in IT for over 20 years, and I know just about enough to realise that I don’t know very much.