Koozali.org: home of the SME Server

Storing Printer Drivers on Server

JonD

Storing Printer Drivers on Server
« on: March 05, 2006, 03:45:24 PM »
I have looked at Dan Brown's How-to
"How to store printer drivers on your server using Samba 2.2.1a"

but I am not sure whether it applies to the current server release 7.
In particular, one of the template file names does not match an
existing template file name.

I am not really familiar with how the template system works so I don't know whether this would be the reason  I couldn't get Dan's solution to work.

Any help would be appreciated.

JonD

silasp

Store print drivers on samba server SME 7
« Reply #1 on: March 22, 2006, 08:29:03 AM »
Hello.
I managed to get this to work, with a lot of help from
http://us2.samba.org/samba/docs/man/Samba-HOWTO-Collection/classicalprinting.html
Here's how.

pico /etc/samba/smb.conf
(because as far as I can see there's no template for this)

Change one line in the [global] section
Code: [Select]

printer admin = admin, Administrator, root, @root


Change one line in the [printers] section
Code: [Select]

[printers]
...
use client driver = no


Change the [print$] section to:
Code: [Select]

[print$]
comment = Printer drivers
path = /home/e-smith/files/samba/printers
guest ok = Yes
browseable = Yes
use client driver = No
read only = Yes
write list = admin, Administrator, root, @root


Save smb.conf and restart samba

service smb restart

Now log on to one of your Windows workstations (I'm using windows 2k, it may be slightly different on other versions)
[1] Start > Run
[2] Type:
Code: [Select]
//servername
in the dialog box (replace servername with the name of your server.)
[3] Open "printers"
[4] Right-click your printer. When the dialog pops up asking if you want to install a driver, click no, then click the "Advanced" tab.
[5] Click the "New Driver" button. Follow the wizard and install the driver
[6] If you want to specify default print settings, click "Printing defaults" from the advanced tab.

Finally, so that you don't have to install the print driver on every windows workstation on the network, you can simply add the following lines to your netlogon.bat file for each printer you want to install:

pico /home/e-smith/files/samba/netlogon/netlogon.bat
Code: [Select]

...
rundll32 printui.dll,PrintUIEntry /dn /n "\\servername\printername" /q
rundll32 printui.dll,PrintUIEntry /in /n "\\servername\printername" /q
rundll32 printui.dll,PrintUIEntry /y /n "\\servername\printername" /q

The first line deletes the printer from the local machine
The second line adds it to the local machine
The (optional) third line sets the printer as the default printer.

There's no easy way to check if a printer has been already installed or not, and the above script only takes a couple of seconds to execute.

For a complete list of Win32 shell print commands, execute the following from the command line:
rundll32 printui.dll,PrintUIEntry /?

Hope that helps.
Cheers,
Silas

Offline JonB

  • *
  • 351
  • +0/-0
Storing Printer Drivers on Server
« Reply #2 on: March 22, 2006, 09:30:05 AM »
Silasp,

You will lose all your changes to smb.conf when you create an ibay, modify an ibay etc.

smb.conf is templated and every time the template is expanded due to an action your changes will be lost.

All you need to do is

db configuration setprop smb UseClientDriver no
expand-template /etc/samba/smb.conf


Jon
...

JonD

Storing Printer Drivers on Server
« Reply #3 on: March 22, 2006, 03:09:14 PM »
Silas & Jon,

Thanks for the info.  I'll give it a try.

Jon:  Could you expand on your suggestion? Not sure of the exact steps I need to follow.  Will it disable all template updates or just the ones related to Silas' suggestion?


JonD

JonD

Storing Printer Drivers on Server
« Reply #4 on: March 25, 2006, 02:35:07 AM »
Based on the help from Silas & Jon, everything now works...

Just to clarify Jon's suggestion, it is 2 words
      no expand-template
in the command.  I got confused because of the word wrap
and had assumed one word.


Thanks,
   Jon

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
printer drivers on SME7rc1
« Reply #5 on: April 01, 2006, 03:25:41 PM »
Hi

None of your solutions works for me.
I've tryed first the easy solution = just this 2 comands:
Code: [Select]

db configuration setprop smb UseClientDriver no

followed by
Code: [Select]

expand-template /etc/samba/smb.conf


I verify that /etc/samba/smb.conf has a
Code: [Select]

use client driver = no


on print$ section of smb.conf

But after all, I just can't save (apply) the changes after driver load.
I'm getting  a deny access message.

If later I go same path I can verify that driver (for XP) is there, just cannot work (upload to workstation).
I also  went to /home/e-smith/files/samba/printers/W32X86/3/  directory and found drivers files over there. They are root:admin with 744 permissions.

Am I doing anything wrong ?

Thanks

Jáder
...

Offline troykd

  • ****
  • 77
  • +0/-0
Printer drivers
« Reply #6 on: April 04, 2006, 03:52:09 AM »
I'd like an easy to follow howto on this as well.  Surprised I can't find it considering this is one of the big benefits of using a Linux server

JonD

Storing Printer Drivers on Server
« Reply #7 on: April 06, 2006, 03:29:11 AM »
I should point out that none of the above is necessary in order to print to a printer that is connected to the server.  It's only a mechanism to store the drivers so that they are readily available to the work stations.

If the workstations already have access to appropriate drivers there's no need to store the drivers on the server (AFAIK).

JonD

Offline domsyn

  • *
  • 13
  • +0/-0
reply to JonD
« Reply #8 on: April 07, 2006, 12:02:54 PM »
It's right,
But it can be really interesting, having the drivers stored on the server during workstation deployement, or to automate new printer deployement through logon script.

Domqyn

JonD

Storing Printer Drivers on Server
« Reply #9 on: April 07, 2006, 01:53:45 PM »
Agreed... and that's exactly why I set it up.  Seems to work as planned so far.

JonD

Offline p-jones

  • *
  • 594
  • +0/-0
Storing Printer Drivers on Server
« Reply #10 on: April 07, 2006, 03:20:16 PM »
JonD, there lots of stuff in this thread, some saying it doesnt work and various ways to "make it work".

Can you please give us a brief summary of what you did to get this sorted for you.

Thanks
p
...

JonD

Storing Printer Drivers on Server
« Reply #11 on: April 07, 2006, 03:30:44 PM »
p,

I followed all of the instructions above by SilasP (mar 22nd)
(not including the rundll32 suggestions)

I then followed that with the command given by JonB... (Mar 22nd)
    db configuration etc.

Please note my comment about using that command. (Mar 24th)

That's it.  So far it has worked for me.

JonD

Offline troykd

  • ****
  • 77
  • +0/-0
Storing Printer Drivers on Server
« Reply #12 on: April 10, 2006, 08:15:49 PM »
I'm lost.

If you don't use the rundll statements, how does it know what printer driver goes with which printer?

Did you change the smb file?  ;I was under the impression that won't work because it's a template.

Offline JonB

  • *
  • 351
  • +0/-0
Storing Printer Drivers on Server
« Reply #13 on: April 10, 2006, 10:58:10 PM »
troykd,

Wait for the next release of SME7. There is a bug in the smb.conf template fragments the handle UseClientDrivers. This has been resolved and will be fixed in the next release.

All you will have to do then is

db configuration setprop smb UseClientDriver no
expand-template /etc/samba/smb.conf

and restart samba

/etc/rc.d/rc7.d/S91smb restart

The only user that has rights to store printer drivers on the server is the server admin so you need to be logged into the domain as admin.

Jon
...

Offline troykd

  • ****
  • 77
  • +0/-0
Storing Printer Drivers on Server
« Reply #14 on: April 11, 2006, 12:43:56 AM »
Thanks JonB!