Thanks to Samba, printing to a remote Microsoft Windows print server is
only slightly more complicated. First, add the local printcap entry:
smb|Remote windows printer:\
:if=/usr/bin/smbprint:\
:lp=/dev/null:\
:sd=/var/spool/lpd/smb:\
:mx#0:
The new key here is if, the input filter. Pointing this to the
smbprint script will cause the print job to be sent to a Windows server
instead of the lp device. We still have to list a device (/dev/null in
this case) which the print daemon uses for locking. But no print jobs will
actually be sent there.
Don't forget to create the spool directory!
# mkdir -p /var/spool/lpd/smb
# chown lp /var/spool/lpd/smb
# chmod 700 /var/spool/lpd/smb
# checkpc -f
# /etc/init.d/lprng restart
In your favorite editor, create a .config file in the spool directory
named above. In this case, /var/spool/lpd/smb/.config:
server="WindowsServerName"
service="PrinterName"
password=""
user=""
Adjust these values to point to the Windows machine and printer name
that you want to use, and you're done:
$ lpr -Psmb sample.txt
The smbprint script should come with Samba, but it isn't included in
all distributions. If you can't find it on your system, you can get it
from the Samba
HOWTO.