Solved Printer Problems
@anthonyglamis In nearly all programs a return code of 0 means success. I don’t think there’s any issues based on the log. Are you noticing errors?
@Tom-Elliott Thanks for the reply, thank you for explaining what that meant. I am not receiving errors, however the printer does not get created. When I navigate to devices and printers, the printer is not installed. Is there a better way to troubleshoot this since I am getting a return code of 0?
Is there a better way to troubleshoot this since I am getting a return code of 0?
Post your printer settings from Printer Management here so we can see what you’ve done. Maybe something will stick out.
My samba share is accessible via windows machines. Directory is \192.168.1.243\printerdrivers
@anthonyglamis Your issue is it is not installing the printer driver.
Your “Printer INF File” being set to /opt/fog/blah is your FOG Server stuff. That particular field should hold the path to the driver within windows. (C:\windows\inf\something.inf). This, I think, is the problem you’re facing.
@Tom-Elliott OK so am I not understanding the WIKI? I set up a Samba share and dumped the driver in /opt/fog/printerdrivers/
I was thinking the Samba share holds the drivers, and you create a printer definition in Fog and the INF file path points to the Samba share directory. I followed this page.
In order for the printer to be added to the host computer, the printer drivers must be stored in a public area, or included on the host computer. This public area can be a Novell Network share where public has read-only access, a Windows share that is public read-only to everyone, or a Samba share (possibly residing on the FOG server) that is public read-only to everyone. This share must be accessible via a UNC path as the service may attempt to install the printers before drive mapping occurs. In this share the printer drives and .inf file must exist. FOG supports install IP based (Jet-Direct) printers, public access NDS printers, Local printers, windows share based printers, (and we think, but could use a confirmation as it hasn’t been tested) AD based printers.
@anthonyglamis While that is potentially possible, the link must be unc, or prior mounted.
Remember, linux uses / for directory separation, but windows uses \ for directory separation.
Even if the samba share is mounted before it looks, you still need to tell it WHERE to look.
Prior mounting is not a good method though as when the service runs, it’s fully possible the mapping hasn’t been done.
Even with that, if the share is located at /opt/fog/, You would still need to access as:
\\ServerName\opt\fog\printerdriver\restoftheway (of course change the parts to get to the real location.
If the mapping has occurred you would change the value to:
2/4/2016 5:23 PM LocalPrinter --> IP = IP_192.168.1.250
Sorry for any repeated information that others said. I saw some posts after I started writing this and didn’t feel like taking out pieces.
The first problem I see is right here.
The printer ip shouldn’t have IP_ in front of it. It should just be the ip address plain and simple
Also the Printer INF File path should be the path to the share that the client uses to access the file. All these fields are passed to the service and run on the computer, so they need to be how the host computer gets to them, not how fog gets to them. i.e. /opt/fog won’t work. \\192.168.1.243\printerdrivers\printer.inf might do the trick
Try testing with an inf file on a local computer with a local path in fog. i.e.
- Put the inf in C:\printer.inf on the client computer
- set the inf file path in fog to C:\printer.inf
That would just see if the service is working for you.
With network shares, I find that it only works with the fog service if it’s already mounted. I.E. A network share mapped through active directory gpo. This is something I hope to improve in the future.
An alternative method is a snapin with a script. Checkout the template script I posted here
Another way of testing the printer install is to test the actual command that the fog service uses to add a printer. It uses a special function for adding a port, but if you don’t already have the port created you can create it with this command in the command line.
Cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\Prnport.vbs -a -r portname -h ipAddress -o raw -n 9100
Then test adding the printer with this command in an administrator command prompt. Which is the way that fog adds it. This will help you confirm your settings further. I took out the /q parameter that goes after /if (install printer from file) so that any error messages won’t be supressed when you test
RUNDLL32 printui.dll,PrintUIEntry /if /b "Printer Name" /f "INF File Path" /r "PortName" /m "Model name from inf file"
If that command adds the printer, then your printer settings are all correct as they are, if it fails, then you should get an error message with more explanation.
Some other caveats I’ve found are that you sometimes need more than just the inf next to the inf. I.e. the .cab, .cat. dlls and stuff that it links to sometimes need to be in the same directory. So if you download a driver package and then unzip it, just use the full extracted folder in your share. You can do some testing and see which is actually neccesarry, cause sometimes just the inf is needed, other times (like with the hp universal print driver) you need the whole folder to get it to install proper.
Personally I currently make a printer script with the template I posted in the above referenced forum post and then add that information to fog. I deploy the script as a snapin to install the printer when the fog service fails to add the printer the FOG printer management successfully removes and keeps the printers that are allowed after it’s installed with that script.
It is surely possible to get the FOG printer management to work as it is in most situations. But I find it easier to have a failsafe for when it has trouble accessing a network share or when it doesn’t like the inf file or something like that.
Also one other little caveat. I noticed that the inf in this one is oem… That’s usually the “published” or “installed” inf file once the printer driver is added to windows and gets appended to or its own happy inf file created in C:\Windows\INF
Sometimes that one works fine, but sometimes that one will contain other printer information and confuse a computer that it wasn’t made on. I usually stick with the inf that the driver comes with that you download off the manufactuer’s website. But that’s just my two cents.
@Tom-Elliott Thanks for the reply and for helping me understand a bit more. I am still unsuccessful at adding a printer.
I tried placing the driver locally on the client in C:\DRIVERS\lanier64 and placed that path on the “printer INF file” section in fog to C:\DRIVERS\lanier64\OEMSETUP.INF, still no luck. The log output states return code 0. I’m wondering if the Model = LANIER MP 5002 PCL 6 field is my issue? I copied the model syntax right from the .INF file.
I also mapped the client to the samba share Z:\192.168.1.243\printerdrivers\lanier64 Input the path on “printer INF file” to Z:\opt\fog\printerdrivers\lanier64\OEMSETUP.INF
Still no luck. I apologize if your previous explanation went completely over my head, but am I missing something terribly easy?
@Arrowhead-IT Just saw this. Thanks for the the reply, I’ll check this out.
@Arrowhead-IT Removing the IP_ was exactly the fix. My printer mapped successfully both ways, locally, and via my samba share. This is good stuff.
@apathetic_admin I’m not sure if this helps you or not but creating TCP/IP definitions has been successful for me. The Samba directions via the Wiki were pretty straight forward. I really didn’t like the idea of placing a ton of printer drivers locally on my “master” images, so the Samba share worked great.