Printing to Windows Shared Printers with Lion
This week has been a struggle of getting Lion to play nicely with Windows Server 2003 based print queues. After numerous visits to a variety of forums, trying everything from forcing them out with Workroup Manager to IP Printing, I have found a (somewhat) simple solution.
Scenario: I would add a printer that was hosted on a Windows share, send a print job and the printer would act like it was going to print, then pause.
It usually would never prompt me to enter a username and password (as required with Windows Server, even when group EVERYONE can print.) and would just set the print queue to paused. Having had an issue with Keychain entries not working, my first step was to delete any keychain entries for the printers, which made no difference.
The logs would be generally full of this type of error:
Backend returned status 1 (failed) [Job 58] Printer stopped due to backend errors; please consult the error_log file for details. [Job 58] End of messages [Job 58] printer-state=5(stopped)
This didn’t help much because I was consulting the error_log file, and this was the error. I tweaked just about every imaginable setting, even attempting to add it via the localhost:631 web based CUPS interface. No matter what I tried, I never got much further than this.
Eventually it dawned on me to check the config files using the command line. One thing I noticed right away was that in the /etc/cups/printers.conf file, there was a line called AuthInfoRequired and the value was negotiate. I had an old printer that was working that I had added prior to the Lion upgrade, and that value was set to username,password instead of negotiate. Surely it can’t be this easy. I made the change in vi, saved it, tried again and it still failed. It then occurred to me that since I was modifying this file, I needed to restart cups. Even after this, it never prompted me for the username and password, which made me believe it wasn’t the solution and I moved on.
Fast forward three days and it’s 3:30 on Friday afternoon. I just kept going back to that printers.conf file knowing there had to be something with that one difference. Nothing else I found in three days of working on this was different, that was the only piece. I tried it again, and made sure I cleared out every Keychain entry for the variety of printers I had tried. I completely cleared my printer list and started fresh. Step by step, here is what I did:
- Cleared all references to the printer out of Keychain.
- Deleted the printer(s)
- Click + to add Other Printer or Scanner.
- Click the Advanced Tab. (If Advanced Tab isn’t available, Control-Click in the toolbar and choose Customize Toolbar and drag the advanced button to the toolbar)
- Under Type choose Windows printer via spoolss

- In the URL, make it smb://servername/printername
- Give it a Name in the Name: field. I stuck with the same name just for kicks, but it shouldn’t make a difference.
- Choose the printer driver/model and click Add.
- Jump over to Terminal and edit /etc/cups/printers.conf and change the AuthInfoRequired negotiate to AuthInfoRequired username,password using vi or text editor of choice.

- Save the changes and restart the computer
- Print a test page and you should be prompted to enter Windows credentials. Save them in Keychain and bask in the glory of a functioning printer.
If you are not familiar with how printers.conf looks, each printer is included in a section that will start with <Printer the_printer_name_here> and all settings between that tag and </Printer> apply to that printer. If you have multiple printers, you may have to scroll through it to locate it. The AuthInfoRequired is about three lines down, directly under the UUID field.
By now, you’re probably wondering why didn’t I just click Windows and add it there. For whatever reason, when I did, it would eventually show the domain, but only one or two random computers. Thinking it was taking a bit to scan the network, I let it sit and think. Nothing. Once the server happened to be one of the random computers that showed up, so I clicked the printer and added it with no problems, just as in Snow Leopard. For whatever, reason it doesn’t work the same in Lion, especially (it seems) when the server is on a different subnet than the client machine.
As background of why I discovered this, we moved away from central print queues due to some networking/territorial disputes/politics on our Macs and moved to strictly IP based printing. If the printer was not networkable, we would use direct USB connections. We are now moving to a managed printing system that requires it to go through a server to track page counts for supply replenishment and billing. We are also moving toward using PaperCut to monitor and eventually attempt to reduce unnecessary printing. Both of these tasks require a hosted print queue.
The IP based printing works flawlessly. With my Snow Leopard machines, moving to the Windows print queues has been painless and worked (so far) without any problems. Part of the problem with our old way of managing them had to do with some integration issues with the Macs. Over the course of the past few months, I believe we’ve solved most of them.



