[Samba] Update to Printiing Chapter for Samba 3.0 HOWTO Collection available

Chris Smith chris at realcomputerguy.com
Fri May 2 05:30:29 GMT 2003

As section 6.8 is a rework of a post of mine to the CUPS newsgroup
(subject "[cups.general] PDF Printing" on 4/11/03 - and, yes, used with
permission via my reply to you in same thread on 4/16/03) I will try to
clarify some points as some of the changes seem inaccurate. Hopefully
others who see this will be able to assist as well and prevent me from
leading you down the wrong path by suggesting a change in error.

It should be mentioned that this technique is not Samba, nor CUPS
specific. It is Windows sys admin stuff and works just fine, as
designed, with Windows servers and systems. Because Samba does what it
does as well as it does this also works with Samba servers regardless of
the printing subsystem (CUPS, for example, is not necessary).

The text follows, I'll preface my comments with "*tcg>".
6.8. Adding Printers upon Logon without User Interaction
The ideas sketched out below are inspired by the Microsoft Knowledgbase
article from:

*tcg> I've used PrintUIEntry in practice for some time. I'm not sure if
"ideas sketched out" is apropos. And the example, as I posted it, was
part of a real logon script currently in use.


A window pops up which shows you all of the options and switches
available. This is only for Win 2k/XP (I should try and find out how far
this is possible in WinNT 4.0 -- anyone with knowledge on this field
reading this??? FIXME). Here's a suggestion what a possible client logon
script could contain (works if 2k/XP Windows clients access printers via

*tcg> I'm fairly positive that PrintUIEntry is not available for NT. The
"via Samba" part at the end is not wholly correct (PrintUIEntry can
install/delete virtually any printer, local or shared via Samba or


Here is a list of the used commanline parameters 

*tcg> typo "commandline".


I have tested this with a Samba 2.2.7a installation and Windows XP
Professional clients. Note that this only works with network printers.

*tcg> this was not part of my post. I have used it with both Win2k and
WinXP clients. It also works with local printers (the arguments are
slightly different).

      * Line 1 deletes a possibly existing previous network printer
        "infotec2105-IPDS" (which had used native Windows drivers with
        LPRng that were removed from the server which was converted to
        CUPS). The "/q" at the end eliminates "Confirm" or error dialog
        boxes popping up. They shouldn't be presented to the user
        logging on....
      * Line 2 adds the new printer "infotec2105-PS" (which actually is
        same physical device but is now run by the new CUPS printing
        system and associated with the CUPS/Adobe PS drivers). The
        printer and his driver has been added to Samba via cupsaddsmb
        and driver is now auto-downloaded to the client PC where the
        user is about to log in.
      * Line 3 sets the default printer to this new network printer
        (which is desired in this case - there are other printers not
        shown here and some may be local as well). This default printer
        selection may only be done for specific systems.

*tcg> my only concern is that someone might assume that only a CUPS
printer using the CUPS/Adobe driver can be added in this way (I would
probably change the example for this HOWTO a little further from my post
on the CUPS newsgroup than you have. As a sidenote, until the CUPS
driver is fixed (http://www.cups.org/str.php?L29), it may be better to
stick with a raw queue.

This procedure installs printers *per user*, not per client machine
(since it is bound to the user's personal logon script).

*tcg> it's not because it is bound to the user's logon script, it's the
way Windows works. If PrintUIEntry was used to install a local printer
it would be per machine, just as local drives and local ports are. A
network printer, like a mapped drive, is connected per user.

 Note that the second line only works if the printer "infotec2105-PS" is
already installed under that same name on "sambacupsserver" as a UNIX
printer, and if the printer drivers have sucessfully been uploaded (via
APW or "cupsaddsmb") into the [print$] driver repository of Samba.

*tcg> I believe that as long as Samba is exporting(sharing) the printer
and a valid driver is available the Windows installation will happen -
even if the printer does not exist in the printing subsystem. The name,
as well, can also be different. Generally these cases would exist if one
is specifying the printers manually and not using the [printers] share.


Hopefully I have been as accurate as I have been boring and pedantic. At
least some good may come of it.

Thank you.

Chris Smith

To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba

More information about the samba-technical mailing list