Problem: Printers hosted on Windows Server 2012 R2 intermittently appear offline on all client computers (Win 7/8/10)
Concept: Let’s learn which components work together for printer sharing
Print sharing is done over SMB protocol using ports 445 and 135. Over the wireshark I was able to see the communication between client and server.
spoolsv.exe is the process (service name: “Print Spooler”) that provides the printer status to the client computers when they open control panel OR hit CTRL + P to print any document.
Drivers convert the document (pdf/word and many others) into a printer language ( PCL 6 drivers used for regular docs, PS drivers are used for printing drawing and layered files). Conversion and printer delivery is also done through spoolsv.exe.
- Keep the driver isolation as “Isolated”. Windows won’t allow us to set this for every driver. Because this is something which the printer driver should support. By setting it to isolated, the drivers runs in a separate process. So in case of a driver crash, it won’t affect spoolsv.exe. Otherwise a driver crash can affect all the printers on the server.
- Windows Server and Client computers should have all the windows updates installed. Take the server snapshot before installing the windows patches. Update some client computers and monitor to see which computers are affected.
Mostly the above two things should solve the problem. But if not, wait for the printers to go offline and check the following:
Do the printers appear offline on the print server? If yes, print spooler looks to have some problem. Get support from Microsoft OR try restoring any old backup and see.
In my case, the printers appear online on the server, but the client see all the shared printers as offline.
To narrow down the problem further, I ran my favorite tool “Wireshark” on the server. Checked for the ports on which clients are communicating when we open the control panel. With this, I was able to identify the port on which clients are trying to communicate with the server for printer status. Now I know the port number.
Checked the resource monitor to find the process listening on that port. Found “spoolsv.exe” is the process. Tried to telnet from client computer to the server on that port and as expected, it did not work.
After restarting the “Print Spooler” service, spoolsv.exe starts using a different port and starts accepting the client connections and shows printers as online
CLICK HERE to learn more about windows printing from Microsoft
SOLUTION:
As the infrastructure was not in scope, asked the concerned team to get assistance from Microsoft support regarding this.
Alternate workarounds are to set a scheduled task and restart the print spooler every morning OR write a PowerShell script which runs on other server and identifies the port on which spoolsv.exe runs. As soon as the other server cannot reach the print server, trigger a service restart on the print server.
Hope this has helped you. If you still have any questions feel free to get in touch with me HERE or write down in the comment below and I’ll get back to you.