[Samba] Samba] Samba3 Printer drivers installation
Kurt Pfeifle
kpfeifle at danka.de
Sun Jan 25 13:29:44 GMT 2004
> [Samba] Samba3 Printer drivers installation
> Andrei Mikhailovsky andrei at arhont.com
> Tue Jan 20 11:52:41 GMT 2004
>
>
> Hello,
>
> I am having problems installing printer drivers for Samsung ML-4500
> printer, so windows workstation can just fetch them from print$ share.
> When I run rpcclient with -d 4 i get the following error:
>
> whale:/home/samba/home# rpcclient -d 4 -Uroot%xxxx -c 'adddriver
> "Windows NT x86"
> "SSGK2:ssgk2.cnt:ssgk2.dat:ssgk2.dll:ssgk2.hlp:ssgk2.ini:ssgk2.sdd:ssgk2su.dll:ssgk2ui.dll:ssgk2um.dll'
> WHALE
Your command is wrong. I can see this by just counting the "colons" in
it. There must be exactly 7 colons -- yours has 9!
[....]
> result was WERR_INVALID_PARAM
>
> Does anyone know what the problem is
Yes.
> and how to fix it?
>
Use the correct syntax :-)
It is described here
http://samba.vernstok.nl/htmldocs/CUPS-printing.html#id2562523
in very great detail, as well as at many other places, like "man rpcclient"
(search for "adddriver"). Admittedly, it is not very simple, so I'll try to
explain again.
The man page quotes this:
adddriver <arch> <config> [<version>]
<arch> is the Win architecture family. It may be either "Windows NT x86"
(which stands for Windows NT 4.0, Windows 2000/2003 and Windows XP) or
"Windows 4.0" (which represents Windows 95/98/ME). You need to use the
quotes because of the spaces in the string.
<config> is the long string, containing 8 separate fields, separated by
7 colons. The last field may contain either "NULL", or a list of additional
driver files *separated by commas*. All this 8 fields must be filled in,
none may be empty (in which case the "NULL" needs to go in), and they need
to be filled in in the correct order. The correct order is this:
LongDriverName:DriverFileName:DataFileName:ConfigFileName:HelpFileName:LanguageMonitorName:DefaultDataType:Comma-Separated-list-of-Files
The LanguageMonitorName field should contain "NULL". The DefaultDataType
for Samba and NT72K/XP clients is "RAW". To find out which files are which
type, use one of these commands to query an existing NT/2000/XP workstation
with the same driver installed locally (and sharing the printer):
rpcclient -U'Administrator' -c 'enumdrivers 3' name-of-remote-win-workstation
rpcclient -U'Administrator' -c 'getdriver printername 3' name-of-remote-win-workstation
The output should show you the correct mapping of driver files to the types
described above (using similar nomenclatura, albeit not exactly the same,
but enough to guess). Note that the list of the "Dependent Files" is what
needs to go, comma-separated, into the last of the 8 mentioned fields in
the adddriver subcommand to rpcclient.
Lastly (AND VERY IMPORTANT!!): all the files you name in the adddriver command
need to be present in [print$]/W32X86/ *before* you run the command. Note,
that the successful command will create a sub-directory named "2" (or "3",
if you use a "version 3", non-kernel-mode driver for 2000/XP) and move the
files there. A partially successful adddriver command could have moved away
a part of the files, and therefor you need to put the files again into the
original location, before you can try again:
Finally, here are 4 examples for a working "rpcclient adddriver" command:
---- 1 ---------------------------------------------------------------------------
rpcclient -U'Administrator%xxxxxxxx' -c 'adddriver "Windows NT x86" \
"HP LaserJet 8100:\
cupsdrvr.dll:\
mopi.ppd:\
cupsui.dll:\
cups.hlp:\
NULL:\
RAW:\
NULL"'\
TURBO_XP
# This command installs the NT/2000/XP CUPS driver into a Windows XP
# Professional workstation named "TURBO_XP", when it is run from any
# Samba machine, and if the files had been placed into (UNC-Notation follows)
# "\\turbo_xp\print$\W32X86\" previously (by, for example an appropriate
# smbclient command....) or (path specific to my own system follows)
# into "C:\WINDOWS\SYSTEM32\SPOOL\drivers\W32X86\"
----------------------------------------------------------------------------------
----- 2 --------------------------------------------------------------------------
rpcclient -U'Administrator%xxxxxxxx' -c 'adddriver "Windows 4.0" \
"HP LaserJet 8100:\
ADOBEPS4.DRV:\
mopi.PPD:\
NULL:\
ADOBEPS4.HLP:\
PSMON.DLL:\RAW:\
ADOBEPS4.DRV,mopi.PPD,ADOBEPS4.HLP,PSMON.DLL,ADFONTS.MFM,DEFPRTR2.PPD,ICONLIB.DLL"'\
TURBO_XP
# This command installs the Win95/98/ME Adobe PostScript driver into the
# Windows XP Professional workstation named "TURBO_XP", when it is run from
# any Samba machine, and if the files had been placed into (UNC-Notation follows)
# "\\turbo_xp\print$\WIN40\" previously (by, for example an appropriate
# smbclient command....) or (path specific to my own system follows)
# into "C:\WINDOWS\SYSTEM32\SPOOL\drivers\WIN40\"
----------------------------------------------------------------------------------
----- 3 --------------------------------------------------------------------------
rpcclient -U'root%xxxx' -c 'adddriver "Windows NT x86" \
"HP LaserJet 8100:\
cupsdrvr.dll:\
mopi.ppd:\
cupsui.dll:\
cups.hlp:\
NULL:\
RAW:\
NULL"'\
localhost
# This command installs the NT/2000/XP CUPS driver the Samba host's
# "print$" share, when it is run on that Samba machine, and
# if the files had been placed into (UNC-Notation follows)
# "\\localhost\print$\W32X86\" previously (by, for example an appropriate
# smbclient command....), or (path specific to my own system follows)
# into "/etc/samba/drivers/W32X86/"
----------------------------------------------------------------------------------
----- 4 --------------------------------------------------------------------------
rpcclient -U'root%xxxx' -c 'adddriver "Windows 4.0" \
"HP LaserJet 8100:\
ADOBEPS4.DRV:\
mopi.PPD:\
NULL:\
ADOBEPS4.HLP:\
PSMON.DLL:\RAW:\
ADOBEPS4.DRV,mopi.PPD,ADOBEPS4.HLP,PSMON.DLL,ADFONTS.MFM,DEFPRTR2.PPD,ICONLIB.DLL"'\
localhost
# This command installs the Win95/98/ME Adobe PostScript driver into a
# Windows XP Professional workstation, when it is run from any Samba
# machine, and if the files had been placed into (UNC-Notation follows)
# "\\localhost\print$\WIN40\" previously (by, for example an appropriate
# smbclient command....), or (path specific to my own system follows)
# into "/etc/samba/drivers/WIN40/"
----------------------------------------------------------------------------------
I hope this helps.
Cheers,
Kurt
More information about the samba
mailing list